--- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -255,6 +255,11 @@ .max(Self::create_item_fungible()) .max(Self::create_item_refungible(data)) } + fn create_multiple_items(amount: u32) -> Weight { + Self::create_multiple_items_nft(amount) + .max(Self::create_multiple_items_fungible(amount)) + .max(Self::create_multiple_items_refungible(amount)) + } fn burn_item() -> Weight { // TODO: refungible, fungible Self::burn_item_nft() @@ -901,9 +906,7 @@ /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item]. /// /// * owner: Address, initial owner of the NFT. - #[weight = >::create_item(items_data.iter() - .map(|data| { data.data_size() as u32 }) - .sum())] + #[weight = >::create_multiple_items(items_data.len() as u32)] #[transactional] pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec) -> DispatchResult { @@ -929,7 +932,7 @@ /// * collection_id: ID of the collection. /// /// * value: New flag value. - #[weight = >::burn_item()] + #[weight = >::set_transfers_enabled_flag()] #[transactional] pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult { --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -25,6 +25,7 @@ 'evm', 'evmcodersubstrate', 'evmcontracthelpers', + 'evmmigration', 'evmtransactionpayment', 'ethereum', 'xcmpqueue', --- a/tests/src/setChainLimits.test.ts +++ b/tests/src/setChainLimits.test.ts @@ -13,7 +13,7 @@ IChainLimits, } from './util/helpers'; -describe('Negative Integration Test setChainLimits', () => { +describe.skip('Negative Integration Test setChainLimits', () => { let alice: IKeyringPair; let bob: IKeyringPair; let dave: IKeyringPair; --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -60,7 +60,7 @@ // tslint:disable-next-line:no-unused-expression expect(result.success).to.be.false; }; - expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees , e.g. account balance too low'); + await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees , e.g. account balance too low'); }); });