difftreelog
Merge pull request #202 from UniqueNetwork/fix/invalid-mode-evm-sponsoring
in: master
Remove "invalid" collection mode, update frontier for sponsoring fixes, readme update, setVariableMetadata usage due CORE-37
13 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2342,7 +2342,7 @@
[[package]]
name = "fc-consensus"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"async-trait",
"derive_more",
@@ -2369,7 +2369,7 @@
[[package]]
name = "fc-db"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"fp-storage",
"kvdb",
@@ -2385,7 +2385,7 @@
[[package]]
name = "fc-mapping-sync"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"fc-consensus",
"fc-db",
@@ -2403,7 +2403,7 @@
[[package]]
name = "fc-rpc"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"ethereum",
"ethereum-types",
@@ -2444,7 +2444,7 @@
[[package]]
name = "fc-rpc-core"
version = "1.1.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"ethereum-types",
"jsonrpc-core 15.1.0",
@@ -2564,7 +2564,7 @@
[[package]]
name = "fp-consensus"
version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"ethereum",
"parity-scale-codec",
@@ -2578,7 +2578,7 @@
[[package]]
name = "fp-evm"
version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"evm",
"impl-trait-for-tuples 0.1.3",
@@ -2591,7 +2591,7 @@
[[package]]
name = "fp-rpc"
version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"ethereum",
"ethereum-types",
@@ -2607,7 +2607,7 @@
[[package]]
name = "fp-storage"
version = "2.0.0"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
[[package]]
name = "frame-benchmarking"
@@ -3239,9 +3239,9 @@
[[package]]
name = "hex-literal"
-version = "0.3.1"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8"
+checksum = "21e4590e13640f19f249fe3e4eca5113bc4289f2497710378190e7f4bd96f45b"
[[package]]
name = "hex_fmt"
@@ -5841,7 +5841,7 @@
[[package]]
name = "pallet-ethereum"
version = "4.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"ethereum",
"ethereum-types",
@@ -5869,7 +5869,7 @@
[[package]]
name = "pallet-evm"
version = "6.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#264af3adc427aefba9ce8a1c5d1c11a6d98d009c"
+source = "git+https://github.com/uniquenetwork/frontier.git?branch=injected-transactions-parachain#9e8630ae4e420f764dad25eec1e0ef41cf6a2694"
dependencies = [
"evm",
"evm-gasometer",
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -63,17 +63,17 @@
2. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.
-3. Install install nightly 2021-03-01 and make it default:
+3. Install install nightly 2021-06-28 and make it default:
```bash
-rustup toolchain install nightly-2021-03-01
-rustup default nightly-2021-03-01
+rustup toolchain install nightly-2021-06-28
+rustup default nightly-2021-06-28
```
4. Add wasm target for nightly toolchain:
```bash
-rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-01
+rustup target add wasm32-unknown-unknown --toolchain nightly-2021-06-28
```
5. Build:
@@ -135,7 +135,7 @@
## Building and Running as Parachain locally
-Rust toolchain: nightly-2021-04-23
+Rust toolchain: nightly-2021-06-28
Note: checkout this project and polkadot project (see below) in the sibling folders (both under the same folder)
### Build relay
@@ -143,7 +143,7 @@
```
git clone https://github.com/paritytech/polkadot.git
cd polkadot
-git checkout aa386760
+git checkout release-v0.9.9
cargo build --release
```
@@ -208,12 +208,12 @@
First of all, add rust toolchain and make it default.
```bash
-rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-01
+rustup target add wasm32-unknown-unknown --toolchain nightly-2021-06-28
```
Then in "/node/src" run build command below
```bash
-cargo +nightly-2020-10-01 build --release --features runtime-benchmarks
+cargo +nightly-2021-06-28 build --release --features runtime-benchmarks
```
Run benchmark
pallets/nft/src/eth/mod.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/mod.rs
+++ b/pallets/nft/src/eth/mod.rs
@@ -103,7 +103,6 @@
CollectionMode::ReFungible => {
include_bytes!("stubs/UniqueRefungible.raw") as &[u8]
}
- CollectionMode::Invalid => include_bytes!("stubs/UniqueInvalid.raw") as &[u8],
}
.to_owned()
})
pallets/nft/src/eth/stubs/UniqueInvalid.rawdiffbeforeafterboth--- a/pallets/nft/src/eth/stubs/UniqueInvalid.raw
+++ /dev/null
@@ -1 +0,0 @@
-TODO
\ No newline at end of file
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -1347,7 +1347,6 @@
sender.clone(),
recipient.clone(),
)?,
- _ => (),
};
Self::deposit_event(RawEvent::Transfer(
@@ -1493,7 +1492,6 @@
from.clone(),
recipient.clone(),
)?,
- _ => (),
};
if matches!(collection.mode, CollectionMode::Fungible(_)) {
@@ -1534,7 +1532,6 @@
Self::set_re_fungible_variable_data(collection, item_id, data)?
}
CollectionMode::Fungible(_) => fail!(Error::<T>::CantStoreMetadataInFungibleTokens),
- _ => fail!(Error::<T>::UnexpectedCollectionType),
};
Ok(())
@@ -1618,7 +1615,6 @@
CollectionMode::NFT => Self::burn_nft_item(collection, item_id)?,
CollectionMode::Fungible(_) => Self::burn_fungible_item(sender, collection, value)?,
CollectionMode::ReFungible => Self::burn_refungible_item(collection, item_id, sender)?,
- _ => (),
};
Ok(())
@@ -1723,9 +1719,6 @@
fail!(Error::<T>::NotReFungibleDataUsedToMintReFungibleCollectionToken);
}
}
- _ => {
- fail!(Error::<T>::UnexpectedCollectionType);
- }
};
Ok(())
@@ -2034,7 +2027,6 @@
.iter()
.find(|i| i.owner == *subject)
.map(|i| i.fraction),
- CollectionMode::Invalid => None,
}
}
@@ -2071,7 +2063,6 @@
CollectionMode::ReFungible => {
<ReFungibleItemList<T>>::contains_key(collection_id, item_id)
}
- _ => false,
};
ensure!(exists, Error::<T>::TokenNotFound);
pallets/nft/src/sponsorship.rsdiffbeforeafterboth--- a/pallets/nft/src/sponsorship.rs
+++ b/pallets/nft/src/sponsorship.rs
@@ -127,7 +127,6 @@
sponsored
}
- _ => false,
};
}
primitives/nft/src/lib.rsdiffbeforeafterboth--- a/primitives/nft/src/lib.rs
+++ b/primitives/nft/src/lib.rs
@@ -73,23 +73,15 @@
#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub enum CollectionMode {
- Invalid,
NFT,
// decimal points
Fungible(DecimalPoints),
ReFungible,
-}
-
-impl Default for CollectionMode {
- fn default() -> Self {
- Self::Invalid
- }
}
impl CollectionMode {
pub fn id(&self) -> u8 {
match self {
- CollectionMode::Invalid => 0,
CollectionMode::NFT => 1,
CollectionMode::Fungible(_) => 2,
CollectionMode::ReFungible => 3,
runtime_types.jsondiffbeforeafterboth1{2 "CrossAccountId": {3 "_enum": {4 "substrate": "AccountId",5 "ethereum": "H160"6 }7 },8 "AccessMode": {9 "_enum": [10 "Normal",11 "WhiteList"12 ]13 },14 "CallSpec": {15 "Module": "u32",16 "Method": "u32"17 },18 "DecimalPoints": "u8",19 "CollectionMode": {20 "_enum": {21 "Invalid": null,22 "NFT": null,23 "Fungible": "DecimalPoints",24 "ReFungible": null25 }26 },27 "Ownership": {28 "Owner": "CrossAccountId",29 "Fraction": "u128"30 },31 "FungibleItemType": {32 "Value": "u128"33 },34 "NftItemType": {35 "Owner": "CrossAccountId",36 "ConstData": "Vec<u8>",37 "VariableData": "Vec<u8>"38 },39 "ReFungibleItemType": {40 "Owner": "Vec<Ownership<CrossAccountId>>",41 "ConstData": "Vec<u8>",42 "VariableData": "Vec<u8>"43 },44 "SponsorshipState": {45 "_enum": {46 "disabled": null,47 "unconfirmed": "AccountId",48 "confirmed": "AccountId"49 }50 },51 "Collection": {52 "Owner": "AccountId",53 "Mode": "CollectionMode",54 "Access": "AccessMode",55 "DecimalPoints": "DecimalPoints",56 "Name": "Vec<u16>",57 "Description": "Vec<u16>",58 "TokenPrefix": "Vec<u8>",59 "MintMode": "bool",60 "OffchainSchema": "Vec<u8>",61 "SchemaVersion": "SchemaVersion",62 "Sponsorship": "SponsorshipState",63 "Limits": "CollectionLimits",64 "VariableOnChainSchema": "Vec<u8>",65 "ConstOnChainSchema": "Vec<u8>",66 "MetaUpdatePermission": "MetaUpdatePermission",67 "TransfersEnabled": "bool"68 },69 "RawData": "Vec<u8>",70 "Address": "MultiAddress",71 "LookupSource": "MultiAddress",72 "Weight": "u64",73 "CreateNftData": {74 "const_data": "Vec<u8>",75 "variable_data": "Vec<u8>" 76 },77 "CreateFungibleData": {78 "value": "u128"79 },80 "CreateReFungibleData": {81 "const_data": "Vec<u8>",82 "variable_data": "Vec<u8>",83 "pieces": "u128"84 },85 "CreateItemData": {86 "_enum": {87 "NFT": "CreateNftData",88 "Fungible": "CreateFungibleData",89 "ReFungible": "CreateReFungibleData"90 }91 },92 "SchemaVersion": {93 "_enum": [94 "ImageURL",95 "Unique"96 ]97 },98 "MetaUpdatePermission": {99 "_enum": [100 "ItemOwner",101 "Admin",102 "None" 103 ]104 },105 "CollectionId": "u32",106 "TokenId": "u32",107 "ChainLimits": {108 "CollectionNumbersLimit": "u32",109 "AccountTokenOwnershipLimit": "u32",110 "CollectionAdminsLimit": "u64",111 "CustomDataLimit": "u32",112 "NftSponsorTimeout": "u32",113 "FungibleSponsorTimeout": "u32",114 "RefungibleSponsorTimeout": "u32",115 "OffchainSchemaLimit": "u32",116 "VariableOnChainSchemaLimit": "u32",117 "ConstOnChainSchemaLimit": "u32"118 },119 "CollectionLimits": {120 "AccountTokenOwnershipLimit": "u32",121 "SponsoredDataSize": "u32",122 "SponsoredDataRateLimit": "Option<BlockNumber>",123 "TokenLimit": "u32",124 "SponsorTimeout": "u32",125 "OwnerCanTransfer": "bool",126 "OwnerCanDestroy": "bool"127 }128}1{2 "CrossAccountId": {3 "_enum": {4 "substrate": "AccountId",5 "ethereum": "H160"6 }7 },8 "AccessMode": {9 "_enum": [10 "Normal",11 "WhiteList"12 ]13 },14 "CallSpec": {15 "Module": "u32",16 "Method": "u32"17 },18 "DecimalPoints": "u8",19 "CollectionMode": {20 "_enum": {21 "NFT": null,22 "Fungible": "DecimalPoints",23 "ReFungible": null24 }25 },26 "Ownership": {27 "Owner": "CrossAccountId",28 "Fraction": "u128"29 },30 "FungibleItemType": {31 "Value": "u128"32 },33 "NftItemType": {34 "Owner": "CrossAccountId",35 "ConstData": "Vec<u8>",36 "VariableData": "Vec<u8>"37 },38 "ReFungibleItemType": {39 "Owner": "Vec<Ownership<CrossAccountId>>",40 "ConstData": "Vec<u8>",41 "VariableData": "Vec<u8>"42 },43 "SponsorshipState": {44 "_enum": {45 "disabled": null,46 "unconfirmed": "AccountId",47 "confirmed": "AccountId"48 }49 },50 "Collection": {51 "Owner": "AccountId",52 "Mode": "CollectionMode",53 "Access": "AccessMode",54 "DecimalPoints": "DecimalPoints",55 "Name": "Vec<u16>",56 "Description": "Vec<u16>",57 "TokenPrefix": "Vec<u8>",58 "MintMode": "bool",59 "OffchainSchema": "Vec<u8>",60 "SchemaVersion": "SchemaVersion",61 "Sponsorship": "SponsorshipState",62 "Limits": "CollectionLimits",63 "VariableOnChainSchema": "Vec<u8>",64 "ConstOnChainSchema": "Vec<u8>",65 "MetaUpdatePermission": "MetaUpdatePermission",66 "TransfersEnabled": "bool"67 },68 "RawData": "Vec<u8>",69 "Address": "MultiAddress",70 "LookupSource": "MultiAddress",71 "Weight": "u64",72 "CreateNftData": {73 "const_data": "Vec<u8>",74 "variable_data": "Vec<u8>" 75 },76 "CreateFungibleData": {77 "value": "u128"78 },79 "CreateReFungibleData": {80 "const_data": "Vec<u8>",81 "variable_data": "Vec<u8>",82 "pieces": "u128"83 },84 "CreateItemData": {85 "_enum": {86 "NFT": "CreateNftData",87 "Fungible": "CreateFungibleData",88 "ReFungible": "CreateReFungibleData"89 }90 },91 "SchemaVersion": {92 "_enum": [93 "ImageURL",94 "Unique"95 ]96 },97 "MetaUpdatePermission": {98 "_enum": [99 "ItemOwner",100 "Admin",101 "None" 102 ]103 },104 "CollectionId": "u32",105 "TokenId": "u32",106 "ChainLimits": {107 "CollectionNumbersLimit": "u32",108 "AccountTokenOwnershipLimit": "u32",109 "CollectionAdminsLimit": "u64",110 "CustomDataLimit": "u32",111 "NftSponsorTimeout": "u32",112 "FungibleSponsorTimeout": "u32",113 "RefungibleSponsorTimeout": "u32",114 "OffchainSchemaLimit": "u32",115 "VariableOnChainSchemaLimit": "u32",116 "ConstOnChainSchemaLimit": "u32"117 },118 "CollectionLimits": {119 "AccountTokenOwnershipLimit": "u32",120 "SponsoredDataSize": "u32",121 "SponsoredDataRateLimit": "Option<BlockNumber>",122 "TokenLimit": "u32",123 "SponsorTimeout": "u32",124 "OwnerCanTransfer": "bool",125 "OwnerCanDestroy": "bool"126 }127}tests/README.mddiffbeforeafterboth--- a/tests/README.md
+++ b/tests/README.md
@@ -5,10 +5,10 @@
1. Checkout polkadot in sibling folder with this project
```bash
git clone https://github.com/paritytech/polkadot.git && cd polkadot
-git checkout aa3867609
+git checkout release-v0.9.9
```
-2. Build with nightly-2021-04-23
+2. Build with nightly-2021-06-28
```bash
cargo build --release
```
tests/src/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/createCollection.test.ts
+++ b/tests/src/createCollection.test.ts
@@ -33,19 +33,6 @@
});
describe('(!negative test!) integration test: ext. createCollection():', () => {
- it('(!negative test!) create new NFT collection whith incorrect data (mode)', async () => {
- await usingApi(async (api) => {
- const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString(), 10);
-
- const badTransaction = async () => {
- await createCollectionExpectSuccess({mode: {type: 'Invalid'}});
- };
- await expect(badTransaction()).to.be.rejected;
-
- const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString(), 10);
- expect(BcollectionCount).to.be.equal(AcollectionCount, 'Error: Incorrect collection created.');
- });
- });
it('(!negative test!) create new NFT collection whith incorrect data (collection_name)', async () => {
await createCollectionExpectFailure({ name: 'A'.repeat(65), mode: {type: 'NFT'}});
});
tests/src/scheduler.test.tsdiffbeforeafterboth--- a/tests/src/scheduler.test.ts
+++ b/tests/src/scheduler.test.ts
@@ -28,7 +28,7 @@
await setCollectionSponsorExpectSuccess(nftCollectionId, Alice.address);
await confirmSponsorshipExpectSuccess(nftCollectionId);
- await scheduleTransferExpectSuccess(nftCollectionId, newNftTokenId, Alice, Bob, 1, 6000, 4);
+ await scheduleTransferExpectSuccess(nftCollectionId, newNftTokenId, Alice, Bob, 1, 12000, 4);
});
});
});
tests/src/setVariableMetaData.test.tsdiffbeforeafterboth--- a/tests/src/setVariableMetaData.test.ts
+++ b/tests/src/setVariableMetaData.test.ts
@@ -17,6 +17,7 @@
setVariableMetaDataExpectFailure,
setVariableMetaDataExpectSuccess,
addCollectionAdminExpectSuccess,
+ setMetadataUpdatePermissionFlagExpectSuccess,
} from './util/helpers';
chai.use(chaiAsPromised);
@@ -62,6 +63,7 @@
bob = privateKey('//Bob');
collectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
+ await setMetadataUpdatePermissionFlagExpectSuccess(alice, collectionId, 'Admin');
await addCollectionAdminExpectSuccess(alice, collectionId, bob);
});
});
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -224,10 +224,6 @@
return result;
}
-interface Invalid {
- type: 'Invalid';
-}
-
interface Nft {
type: 'NFT';
}
@@ -241,7 +237,7 @@
type: 'ReFungible';
}
-type CollectionMode = Nft | Fungible | ReFungible | Invalid;
+type CollectionMode = Nft | Fungible | ReFungible;
export type CreateCollectionParams = {
mode: CollectionMode,
@@ -275,8 +271,6 @@
modeprm = { fungible: mode.decimalPoints };
} else if (mode.type === 'ReFungible') {
modeprm = { refungible: null };
- } else if (mode.type === 'Invalid') {
- modeprm = { invalid: null };
}
const tx = api.tx.nft.createCollection(strToUTF16(name), strToUTF16(description), strToUTF16(tokenPrefix), modeprm);
@@ -317,8 +311,6 @@
modeprm = { fungible: mode.decimalPoints };
} else if (mode.type === 'ReFungible') {
modeprm = { refungible: null };
- } else if (mode.type === 'Invalid') {
- modeprm = { invalid: null };
}
await usingApi(async (api) => {
@@ -528,23 +520,23 @@
export async function setMetadataUpdatePermissionFlagExpectSuccess(sender: IKeyringPair, collectionId: number, flag: string) {
await usingApi(async (api) => {
- const tx = api.tx.nft.setMetaUpdatePermissionFlag(collectionId, flag);
+ const tx = api.tx.nft.setMetaUpdatePermissionFlag(collectionId, flag);
const events = await submitTransactionAsync(sender, tx);
const result = getGenericResult(events);
expect(result.success).to.be.true;
- });
+ });
}
export async function setMetadataUpdatePermissionFlagExpectFailure(sender: IKeyringPair, collectionId: number, flag: string) {
await usingApi(async (api) => {
- const tx = api.tx.nft.setMetaUpdatePermissionFlag(collectionId, flag);
+ const tx = api.tx.nft.setMetaUpdatePermissionFlag(collectionId, flag);
const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
const result = getGenericResult(events);
expect(result.success).to.be.false;
- });
+ });
}
export async function enableContractSponsoringExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, enable: boolean) {
@@ -576,7 +568,7 @@
const result = getGenericResult(events);
expect(result.success).to.be.true;
- });
+ });
}
export async function setTransferFlagExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) {
@@ -588,7 +580,7 @@
const result = getGenericResult(events);
expect(result.success).to.be.false;
- });
+ });
}
export async function setContractSponsoringRateLimitExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, rateLimit: number) {
@@ -833,7 +825,7 @@
const expectedBlockNumber = blockNumber + blockSchedule;
expect(blockNumber).to.be.greaterThan(0);
- const transferTx = await api.tx.nft.transfer(normalizeAccountId(recipient.address), collectionId, tokenId, value);
+ const transferTx = await api.tx.nft.transfer(normalizeAccountId(recipient.address), collectionId, tokenId, value);
const scheduleTx = await api.tx.scheduler.schedule(expectedBlockNumber, null, 0, transferTx);
await submitTransactionAsync(sender, scheduleTx);
@@ -1004,7 +996,7 @@
export async function createItemExpectFailure(sender: IKeyringPair, collectionId: number, createMode: string, owner: string = sender.address) {
await usingApi(async (api) => {
const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(owner), createMode);
-
+
const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
const result = getCreateItemResult(events);