difftreelog
refactor remove meta update permission
in: master
11 files changed
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -22,7 +22,7 @@
use pallet_evm::account::CrossAccountId;
use frame_support::{
dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo, Weight, PostDispatchInfo},
- ensure, fail,
+ ensure,
traits::{Imbalance, Get, Currency, WithdrawReasons, ExistenceRequirement},
BoundedVec,
weights::Pays,
@@ -30,7 +30,7 @@
use pallet_evm::GasWeightMapping;
use up_data_structs::{
COLLECTION_NUMBER_LIMIT, Collection, RpcCollection, CollectionId, CreateItemData,
- MAX_TOKEN_PREFIX_LENGTH, COLLECTION_ADMINS_LIMIT, MetaUpdatePermission, TokenId,
+ MAX_TOKEN_PREFIX_LENGTH, COLLECTION_ADMINS_LIMIT, TokenId,
CollectionStats, MAX_TOKEN_OWNERSHIP, CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT,
FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT,
CUSTOM_DATA_LIMIT, CollectionLimits, CreateCollectionData, SponsorshipState,
@@ -134,21 +134,6 @@
<Error<T>>::AddressNotInAllowlist
);
Ok(())
- }
-
- pub fn check_can_update_meta(
- &self,
- subject: &T::CrossAccountId,
- item_owner: &T::CrossAccountId,
- ) -> DispatchResult {
- match self.meta_update_permission {
- MetaUpdatePermission::ItemOwner => {
- ensure!(subject == item_owner, <Error<T>>::NoPermission);
- Ok(())
- }
- MetaUpdatePermission::Admin => self.check_is_owner_or_admin(subject),
- MetaUpdatePermission::None => fail!(<Error<T>>::NoPermission),
- }
}
}
@@ -565,7 +550,6 @@
schema_version,
sponsorship,
limits,
- meta_update_permission,
} = <CollectionById<T>>::get(collection)?;
let token_property_permissions = <CollectionPropertyPermissions<T>>::get(collection)
@@ -595,7 +579,6 @@
schema_version,
sponsorship,
limits,
- meta_update_permission,
offchain_schema: <CollectionData<T>>::get((
collection,
CollectionField::OffchainSchema,
@@ -656,7 +639,6 @@
.limits
.map(|limits| Self::clamp_limits(data.mode.clone(), &Default::default(), limits))
.unwrap_or_else(|| Ok(CollectionLimits::default()))?,
- meta_update_permission: data.meta_update_permission.unwrap_or_default(),
};
let mut collection_properties = up_data_structs::CollectionProperties::get();
pallets/unique/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/unique/src/benchmarking.rs
+++ b/pallets/unique/src/benchmarking.rs
@@ -168,9 +168,4 @@
nesting_rule: None,
};
}: set_collection_limits(RawOrigin::Signed(caller.clone()), collection, cl)
-
- set_meta_update_permission_flag {
- let caller: T::AccountId = account("caller", 0, SEED);
- let collection = create_nft_collection::<T>(caller.clone())?;
- }: _(RawOrigin::Signed(caller.clone()), collection, MetaUpdatePermission::Admin)
}
pallets/unique/src/lib.rsdiffbeforeafterboth--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -38,12 +38,12 @@
CONST_ON_CHAIN_SCHEMA_LIMIT, OFFCHAIN_SCHEMA_LIMIT,
MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH,
AccessMode, CreateItemData, CollectionLimits, CollectionId, CollectionMode, TokenId,
- SchemaVersion, SponsorshipState, MetaUpdatePermission, CreateCollectionData,
+ SchemaVersion, SponsorshipState, CreateCollectionData,
CreateItemExData, budget, CollectionField, Property, PropertyKey, PropertyKeyPermission,
};
use pallet_evm::account::CrossAccountId;
use pallet_common::{
- CollectionHandle, Pallet as PalletCommon, Error as CommonError, CommonWeightInfo,
+ CollectionHandle, Pallet as PalletCommon, CommonWeightInfo,
dispatch::dispatch_call, dispatch::CollectionDispatch,
};
@@ -925,34 +925,6 @@
let budget = budget::Value::new(2);
dispatch_call::<T, _>(collection_id, |d| d.transfer_from(sender, from, recipient, item_id, value, &budget))
- }
-
- /// Set meta_update_permission value for particular collection
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- ///
- /// # Arguments
- ///
- /// * collection_id: ID of the collection.
- ///
- /// * value: New flag value.
- #[weight = <SelfWeightOf<T>>::set_meta_update_permission_flag()]
- #[transactional]
- pub fn set_meta_update_permission_flag(origin, collection_id: CollectionId, value: MetaUpdatePermission) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
-
- ensure!(
- target_collection.meta_update_permission != MetaUpdatePermission::None,
- <CommonError<T>>::MetadataFlagFrozen,
- );
- target_collection.check_is_owner(&sender)?;
-
- target_collection.meta_update_permission = value;
-
- target_collection.save()
}
/// Set schema standard
pallets/unique/src/weights.rsdiffbeforeafterboth--- a/pallets/unique/src/weights.rs
+++ b/pallets/unique/src/weights.rs
@@ -49,7 +49,6 @@
fn set_const_on_chain_schema(b: u32, ) -> Weight;
fn set_schema_version() -> Weight;
fn set_collection_limits() -> Weight;
- fn set_meta_update_permission_flag() -> Weight;
}
/// Weights for pallet_unique using the Substrate node and recommended hardware.
@@ -167,12 +166,6 @@
// Storage: Common CollectionById (r:1 w:1)
fn set_collection_limits() -> Weight {
(15_339_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_meta_update_permission_flag() -> Weight {
- (7_214_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -292,12 +285,6 @@
// Storage: Common CollectionById (r:1 w:1)
fn set_collection_limits() -> Weight {
(15_339_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_meta_update_permission_flag() -> Weight {
- (7_214_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -308,6 +308,7 @@
#[version(..2)]
pub const_on_chain_schema: BoundedVec<u8, ConstU32<CONST_ON_CHAIN_SCHEMA_LIMIT>>,
+ #[version(..2)]
pub meta_update_permission: MetaUpdatePermission,
}
@@ -327,7 +328,6 @@
pub sponsorship: SponsorshipState<AccountId>,
pub limits: CollectionLimits,
pub const_on_chain_schema: Vec<u8>,
- pub meta_update_permission: MetaUpdatePermission,
pub token_property_permissions: Vec<PropertyKeyPermission>,
pub properties: Vec<Property>,
}
@@ -353,7 +353,6 @@
pub pending_sponsor: Option<AccountId>,
pub limits: Option<CollectionLimits>,
pub const_on_chain_schema: BoundedVec<u8, ConstU32<CONST_ON_CHAIN_SCHEMA_LIMIT>>,
- pub meta_update_permission: Option<MetaUpdatePermission>,
pub token_property_permissions: CollectionPropertiesPermissionsVec,
pub properties: CollectionPropertiesVec,
}
@@ -493,17 +492,10 @@
}
#[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum MetaUpdatePermission {
ItemOwner,
Admin,
None,
-}
-
-impl Default for MetaUpdatePermission {
- fn default() -> Self {
- Self::ItemOwner
- }
}
#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
runtime/tests/src/tests.rsdiffbeforeafterboth--- a/runtime/tests/src/tests.rs
+++ b/runtime/tests/src/tests.rs
@@ -18,7 +18,7 @@
use crate::{Test, TestCrossAccountId, CollectionCreationPrice, Origin, Unique, new_test_ext};
use up_data_structs::{
COLLECTION_NUMBER_LIMIT, CollectionId, CreateItemData, CreateFungibleData, CreateNftData,
- CreateReFungibleData, MAX_DECIMAL_POINTS, COLLECTION_ADMINS_LIMIT, MetaUpdatePermission,
+ CreateReFungibleData, MAX_DECIMAL_POINTS, COLLECTION_ADMINS_LIMIT,
TokenId, MAX_TOKEN_OWNERSHIP, CreateCollectionData, CollectionField, SchemaVersion,
CollectionMode, AccessMode,
};
@@ -2467,32 +2467,6 @@
assert_eq!(
<pallet_nonfungible::AccountBalance<Test>>::get((collection_id, account(2))),
1
- );
- });
-}
-
-#[test]
-fn set_variable_meta_flag_after_freeze() {
- new_test_ext().execute_with(|| {
- // default_limits();
-
- let collection_id =
- create_test_collection_for_owner(&CollectionMode::NFT, 2, CollectionId(1));
-
- let origin2 = Origin::signed(2);
-
- assert_ok!(Unique::set_meta_update_permission_flag(
- origin2.clone(),
- collection_id,
- MetaUpdatePermission::None,
- ));
- assert_noop!(
- Unique::set_meta_update_permission_flag(
- origin2.clone(),
- collection_id,
- MetaUpdatePermission::Admin
- ),
- CommonError::<Test>::MetadataFlagFrozen
);
});
}
tests/src/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/createCollection.test.ts
+++ b/tests/src/createCollection.test.ts
@@ -74,7 +74,6 @@
accountTokenOwnershipLimit: 3,
},
constOnChainSchema: '0x333333',
- metaUpdatePermission: 'Admin',
});
const events = await submitTransactionAsync(alice, tx);
const result = getCreateCollectionResult(events);
@@ -91,7 +90,6 @@
expect(collection.sponsorship.asUnconfirmed.toString()).to.equal(bob.address);
expect(collection.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.equal(3);
expect(collection.constOnChainSchema.toString()).to.equal('0x333333');
- expect(collection.metaUpdatePermission.isAdmin).to.be.true;
});
});
});
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import privateKey from '../substrate/privateKey';
-import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE, setMetadataUpdatePermissionFlagExpectSuccess} from '../util/helpers';
+import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers';
import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';
import nonFungibleAbi from './nonFungibleAbi.json';
import {expect} from 'chai';
tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import privateKey from '../../substrate/privateKey';18import {createCollectionExpectSuccess, createItemExpectSuccess, setMetadataUpdatePermissionFlagExpectSuccess} from '../../util/helpers';19import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers';20import nonFungibleAbi from '../nonFungibleAbi.json';21import {expect} from 'chai';22import {submitTransactionAsync} from '../../substrate/substrate-api';23import Web3 from 'web3';24import {readFile} from 'fs/promises';25import {ApiPromise} from '@polkadot/api';2627async function proxyWrap(api: ApiPromise, web3: Web3, wrapped: any) {28 // Proxy owner has no special privilegies, we don't need to reuse them29 const owner = await createEthAccountWithBalance(api, web3);30 const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueNFTProxy.abi`)).toString()), undefined, {31 from: owner,32 ...GAS_ARGS,33 });34 const proxy = await proxyContract.deploy({data: (await readFile(`${__dirname}/UniqueNFTProxy.bin`)).toString(), arguments: [wrapped.options.address]}).send({from: owner});35 return proxy;36}3738describe('NFT (Via EVM proxy): Information getting', () => {39 itWeb3('totalSupply', async ({api, web3}) => {40 const collection = await createCollectionExpectSuccess({41 mode: {type: 'NFT'},42 });43 const alice = privateKey('//Alice');44 const caller = await createEthAccountWithBalance(api, web3);4546 await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});4748 const address = collectionIdToAddress(collection);49 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));50 const totalSupply = await contract.methods.totalSupply().call();5152 expect(totalSupply).to.equal('1');53 });5455 itWeb3('balanceOf', async ({api, web3}) => {56 const collection = await createCollectionExpectSuccess({57 mode: {type: 'NFT'},58 });59 const alice = privateKey('//Alice');6061 const caller = await createEthAccountWithBalance(api, web3);62 await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});63 await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});64 await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});6566 const address = collectionIdToAddress(collection);67 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));68 const balance = await contract.methods.balanceOf(caller).call();6970 expect(balance).to.equal('3');71 });7273 itWeb3('ownerOf', async ({api, web3}) => {74 const collection = await createCollectionExpectSuccess({75 mode: {type: 'NFT'},76 });77 const alice = privateKey('//Alice');7879 const caller = await createEthAccountWithBalance(api, web3);80 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});8182 const address = collectionIdToAddress(collection);83 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));84 const owner = await contract.methods.ownerOf(tokenId).call();8586 expect(owner).to.equal(caller);87 });88});8990describe('NFT (Via EVM proxy): Plain calls', () => {91 itWeb3('Can perform mint()', async ({web3, api}) => {92 const collection = await createCollectionExpectSuccess({93 mode: {type: 'NFT'},94 });95 const alice = privateKey('//Alice');96 const caller = await createEthAccountWithBalance(api, web3);97 const receiver = createEthAccount(web3);9899 const address = collectionIdToAddress(collection);100 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));101102 const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: contract.options.address});103 await submitTransactionAsync(alice, changeAdminTx);104105 {106 const nextTokenId = await contract.methods.nextTokenId().call();107 expect(nextTokenId).to.be.equal('1');108 const result = await contract.methods.mintWithTokenURI(109 receiver,110 nextTokenId,111 'Test URI',112 ).send({from: caller});113 const events = normalizeEvents(result.events);114115 expect(events).to.be.deep.equal([116 {117 address,118 event: 'Transfer',119 args: {120 from: '0x0000000000000000000000000000000000000000',121 to: receiver,122 tokenId: nextTokenId,123 },124 },125 ]);126127 expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');128 }129 });130 itWeb3('Can perform mintBulk()', async ({web3, api}) => {131 const collection = await createCollectionExpectSuccess({132 mode: {type: 'NFT'},133 });134 const alice = privateKey('//Alice');135136 const caller = await createEthAccountWithBalance(api, web3);137 const receiver = createEthAccount(web3);138139 const address = collectionIdToAddress(collection);140 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));141 const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: contract.options.address});142 await submitTransactionAsync(alice, changeAdminTx);143144 {145 const nextTokenId = await contract.methods.nextTokenId().call();146 expect(nextTokenId).to.be.equal('1');147 const result = await contract.methods.mintBulkWithTokenURI(148 receiver,149 [150 [nextTokenId, 'Test URI 0'],151 [+nextTokenId + 1, 'Test URI 1'],152 [+nextTokenId + 2, 'Test URI 2'],153 ],154 ).send({from: caller});155 const events = normalizeEvents(result.events);156157 expect(events).to.be.deep.equal([158 {159 address,160 event: 'Transfer',161 args: {162 from: '0x0000000000000000000000000000000000000000',163 to: receiver,164 tokenId: nextTokenId,165 },166 },167 {168 address,169 event: 'Transfer',170 args: {171 from: '0x0000000000000000000000000000000000000000',172 to: receiver,173 tokenId: String(+nextTokenId + 1),174 },175 },176 {177 address,178 event: 'Transfer',179 args: {180 from: '0x0000000000000000000000000000000000000000',181 to: receiver,182 tokenId: String(+nextTokenId + 2),183 },184 },185 ]);186187 expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI 0');188 expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1');189 expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2');190 }191 });192193 itWeb3('Can perform burn()', async ({web3, api}) => {194 const collection = await createCollectionExpectSuccess({195 mode: {type: 'NFT'},196 });197 const alice = privateKey('//Alice');198 const caller = await createEthAccountWithBalance(api, web3);199200 const address = collectionIdToAddress(collection);201 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));202 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address});203204 const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: contract.options.address});205 await submitTransactionAsync(alice, changeAdminTx);206207 {208 const result = await contract.methods.burn(tokenId).send({from: caller});209 const events = normalizeEvents(result.events);210211 expect(events).to.be.deep.equal([212 {213 address,214 event: 'Transfer',215 args: {216 from: contract.options.address,217 to: '0x0000000000000000000000000000000000000000',218 tokenId: tokenId.toString(),219 },220 },221 ]);222 }223 });224225 itWeb3('Can perform approve()', async ({web3, api}) => {226 const collection = await createCollectionExpectSuccess({227 mode: {type: 'NFT'},228 });229 const alice = privateKey('//Alice');230 const caller = await createEthAccountWithBalance(api, web3);231 const spender = createEthAccount(web3);232233 const address = collectionIdToAddress(collection);234 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address));235 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address});236237 {238 const result = await contract.methods.approve(spender, tokenId).send({from: caller, ...GAS_ARGS});239 const events = normalizeEvents(result.events);240241 expect(events).to.be.deep.equal([242 {243 address,244 event: 'Approval',245 args: {246 owner: contract.options.address,247 approved: spender,248 tokenId: tokenId.toString(),249 },250 },251 ]);252 }253 });254255 itWeb3('Can perform transferFrom()', async ({web3, api}) => {256 const collection = await createCollectionExpectSuccess({257 mode: {type: 'NFT'},258 });259 const alice = privateKey('//Alice');260 const caller = await createEthAccountWithBalance(api, web3);261 const owner = await createEthAccountWithBalance(api, web3);262263 const receiver = createEthAccount(web3);264265 const address = collectionIdToAddress(collection);266 const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});267 const contract = await proxyWrap(api, web3, evmCollection);268 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner});269270 await evmCollection.methods.approve(contract.options.address, tokenId).send({from: owner});271272 {273 const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({from: caller});274 const events = normalizeEvents(result.events);275 expect(events).to.be.deep.equal([276 {277 address,278 event: 'Transfer',279 args: {280 from: owner,281 to: receiver,282 tokenId: tokenId.toString(),283 },284 },285 ]);286 }287288 {289 const balance = await contract.methods.balanceOf(receiver).call();290 expect(+balance).to.equal(1);291 }292293 {294 const balance = await contract.methods.balanceOf(contract.options.address).call();295 expect(+balance).to.equal(0);296 }297 });298299 itWeb3('Can perform transfer()', async ({web3, api}) => {300 const collection = await createCollectionExpectSuccess({301 mode: {type: 'NFT'},302 });303 const alice = privateKey('//Alice');304 const caller = await createEthAccountWithBalance(api, web3);305 const receiver = createEthAccount(web3);306307 const address = collectionIdToAddress(collection);308 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));309 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address});310311 {312 const result = await contract.methods.transfer(receiver, tokenId).send({from: caller});313 const events = normalizeEvents(result.events);314 expect(events).to.be.deep.equal([315 {316 address,317 event: 'Transfer',318 args: {319 from: contract.options.address,320 to: receiver,321 tokenId: tokenId.toString(),322 },323 },324 ]);325 }326327 {328 const balance = await contract.methods.balanceOf(contract.options.address).call();329 expect(+balance).to.equal(0);330 }331332 {333 const balance = await contract.methods.balanceOf(receiver).call();334 expect(+balance).to.equal(1);335 }336 });337});tests/src/nesting/migration-check.test.tsdiffbeforeafterboth--- a/tests/src/nesting/migration-check.test.ts
+++ b/tests/src/nesting/migration-check.test.ts
@@ -37,7 +37,6 @@
accountTokenOwnershipLimit: 3,
},
constOnChainSchema: '0x333333',
- metaUpdatePermission: 'Admin',
});
const events = await submitTransactionAsync(alice, tx);
const result = getCreateCollectionResult(events);
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -650,28 +650,6 @@
});
}
-export async function setMetadataUpdatePermissionFlagExpectSuccess(sender: IKeyringPair, collectionId: number, flag: string) {
-
- await usingApi(async (api) => {
- const tx = api.tx.unique.setMetaUpdatePermissionFlag(collectionId, flag as any);
- 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.unique.setMetaUpdatePermissionFlag(collectionId, flag as any);
- 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) {
await usingApi(async (api) => {
const tx = api.tx.unique.enableContractSponsoring(contractAddress, enable);