difftreelog
refac: rename substrate methods to cross
in: master
16 files changed
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -656,7 +656,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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>(
pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -385,7 +385,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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()
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -471,7 +471,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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()
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -471,7 +471,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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()
tests/src/eth/allowlist.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 {IKeyringPair} from '@polkadot/types/types';18import {itEth, usingEthPlaygrounds, expect} from './util';1920describe('EVM contract allowlist', () => {21 let donor: IKeyringPair;2223 before(async function() {24 await usingEthPlaygrounds(async (_helper, privateKey) => {25 donor = await privateKey({filename: __filename});26 });27 });2829 itEth('Contract allowlist can be toggled', async ({helper}) => {30 const owner = await helper.eth.createAccountWithBalance(donor);31 const flipper = await helper.eth.deployFlipper(owner);32 const helpers = helper.ethNativeContract.contractHelpers(owner);3334 // Any user is allowed by default35 expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false;3637 // Enable38 await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});39 expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.true;4041 // Disable42 await helpers.methods.toggleAllowlist(flipper.options.address, false).send({from: owner});43 expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false;44 });4546 itEth('Non-allowlisted user can\'t call contract with allowlist enabled', async ({helper}) => {47 const owner = await helper.eth.createAccountWithBalance(donor);48 const caller = await helper.eth.createAccountWithBalance(donor);49 const flipper = await helper.eth.deployFlipper(owner);50 const helpers = helper.ethNativeContract.contractHelpers(owner);5152 // User can flip with allowlist disabled53 await flipper.methods.flip().send({from: caller});54 expect(await flipper.methods.getValue().call()).to.be.true;5556 // Tx will be reverted if user is not in allowlist57 await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});58 await expect(flipper.methods.flip().send({from: caller})).to.rejected;59 expect(await flipper.methods.getValue().call()).to.be.true;6061 // Adding caller to allowlist will make contract callable again62 await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});63 await flipper.methods.flip().send({from: caller});64 expect(await flipper.methods.getValue().call()).to.be.false;65 });66});6768describe('EVM collection allowlist', () => {69 let donor: IKeyringPair;7071 before(async function() {72 await usingEthPlaygrounds(async (_helper, privateKey) => {73 donor = await privateKey({filename: __filename});74 });75 });7677 itEth('Collection allowlist can be added and removed by [eth] address', async ({helper}) => {78 const owner = await helper.eth.createAccountWithBalance(donor);79 const user = helper.eth.createAccount();8081 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');82 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);8384 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;85 await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});86 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true;8788 await collectionEvm.methods.removeFromCollectionAllowList(user).send({from: owner});89 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;90 });9192 //itEth('Collection allowlist can be added and removed by [cross] address', async ({helper}) => {93 // const owner = await helper.eth.createAccountWithBalance(donor);94 // const user = donor;95 // 96 // const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');97 // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);98 // const userCross = helper.ethCrossAccount.fromKeyringPair(user);99 // 100 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;101 // await collectionEvm.methods.addToCollectionAllowListCross(userCross).send({from: owner});102 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true;103 // 104 // await collectionEvm.methods.removeFromCollectionAllowListCross(userCross).send({from: owner});105 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;106 //});107108 itEth('Collection allowlist can not be add and remove [eth] address by not owner', async ({helper}) => {109 const owner = await helper.eth.createAccountWithBalance(donor);110 const notOwner = await helper.eth.createAccountWithBalance(donor);111 const user = helper.eth.createAccount();112113 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');114 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);115116 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;117 await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission');118 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;119 await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});120 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true;121 await expect(collectionEvm.methods.removeFromCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission');122 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true;123 });124125 //itEth('Collection allowlist can not be add and remove [cross] address by not owner', async ({helper}) => {126 // const owner = await helper.eth.createAccountWithBalance(donor);127 // const notOwner = await helper.eth.createAccountWithBalance(donor);128 // const user = donor;129 // 130 // const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');131 // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);132 // 133 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;134 // const userCross = helper.ethCrossAccount.fromKeyringPair(user);135 // await expect(collectionEvm.methods.addToCollectionAllowListCross(userCross).call({from: notOwner})).to.be.rejectedWith('NoPermission');136 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;137 // await collectionEvm.methods.addToCollectionAllowListCross(userCross).send({from: owner});138 // 139 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true;140 // await expect(collectionEvm.methods.removeFromCollectionAllowListCross(userCross).call({from: notOwner})).to.be.rejectedWith('NoPermission');141 // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true;142 //});143});1// 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 {IKeyringPair} from '@polkadot/types/types';18import {itEth, usingEthPlaygrounds, expect} from './util';1920describe('EVM contract allowlist', () => {21 let donor: IKeyringPair;2223 before(async function() {24 await usingEthPlaygrounds(async (_helper, privateKey) => {25 donor = await privateKey({filename: __filename});26 });27 });2829 itEth('Contract allowlist can be toggled', async ({helper}) => {30 const owner = await helper.eth.createAccountWithBalance(donor);31 const flipper = await helper.eth.deployFlipper(owner);32 const helpers = helper.ethNativeContract.contractHelpers(owner);3334 // Any user is allowed by default35 expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false;3637 // Enable38 await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});39 expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.true;4041 // Disable42 await helpers.methods.toggleAllowlist(flipper.options.address, false).send({from: owner});43 expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false;44 });4546 itEth('Non-allowlisted user can\'t call contract with allowlist enabled', async ({helper}) => {47 const owner = await helper.eth.createAccountWithBalance(donor);48 const caller = await helper.eth.createAccountWithBalance(donor);49 const flipper = await helper.eth.deployFlipper(owner);50 const helpers = helper.ethNativeContract.contractHelpers(owner);5152 // User can flip with allowlist disabled53 await flipper.methods.flip().send({from: caller});54 expect(await flipper.methods.getValue().call()).to.be.true;5556 // Tx will be reverted if user is not in allowlist57 await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});58 await expect(flipper.methods.flip().send({from: caller})).to.rejected;59 expect(await flipper.methods.getValue().call()).to.be.true;6061 // Adding caller to allowlist will make contract callable again62 await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});63 await flipper.methods.flip().send({from: caller});64 expect(await flipper.methods.getValue().call()).to.be.false;65 });66});6768describe('EVM collection allowlist', () => {69 let donor: IKeyringPair;7071 before(async function() {72 await usingEthPlaygrounds(async (_helper, privateKey) => {73 donor = await privateKey({filename: __filename});74 });75 });7677 itEth('Collection allowlist can be added and removed by [eth] address', async ({helper}) => {78 const owner = await helper.eth.createAccountWithBalance(donor);79 const user = helper.eth.createAccount();8081 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');82 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);8384 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;85 await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});86 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true;8788 await collectionEvm.methods.removeFromCollectionAllowList(user).send({from: owner});89 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;90 });9192 itEth('Collection allowlist can be added and removed by [cross] address', async ({helper}) => {93 const owner = await helper.eth.createAccountWithBalance(donor);94 const user = donor;95 96 const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C');97 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);98 const userCross = helper.ethCrossAccount.fromKeyringPair(user);99 100 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;101 await collectionEvm.methods.addToCollectionAllowListCross(userCross).send({from: owner});102 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true;103 104 await collectionEvm.methods.removeFromCollectionAllowListCross(userCross).send({from: owner});105 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;106 });107108 itEth('Collection allowlist can not be add and remove [eth] address by not owner', async ({helper}) => {109 const owner = await helper.eth.createAccountWithBalance(donor);110 const notOwner = await helper.eth.createAccountWithBalance(donor);111 const user = helper.eth.createAccount();112113 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');114 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);115116 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;117 await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission');118 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false;119 await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});120 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true;121 await expect(collectionEvm.methods.removeFromCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission');122 expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true;123 });124125 itEth('Collection allowlist can not be add and remove [cross] address by not owner', async ({helper}) => {126 const owner = await helper.eth.createAccountWithBalance(donor);127 const notOwner = await helper.eth.createAccountWithBalance(donor);128 const user = donor;129 130 const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C');131 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);132 133 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;134 const userCross = helper.ethCrossAccount.fromKeyringPair(user);135 await expect(collectionEvm.methods.addToCollectionAllowListCross(userCross).call({from: notOwner})).to.be.rejectedWith('NoPermission');136 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false;137 await collectionEvm.methods.addToCollectionAllowListCross(userCross).send({from: owner});138 139 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true;140 await expect(collectionEvm.methods.removeFromCollectionAllowListCross(userCross).call({from: notOwner})).to.be.rejectedWith('NoPermission');141 expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true;142 });143});tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -249,7 +249,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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()
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -306,7 +306,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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()
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -306,7 +306,7 @@
/// Get collection owner.
///
- /// @return Tuple with sponsor address and his substrate mirror.
+ /// @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()
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionAdmin.test.ts
+++ b/tests/src/eth/collectionAdmin.test.ts
@@ -53,10 +53,10 @@
itEth('Add cross account admin by owner', async ({helper, privateKey}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
+ const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C');
const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
- const newAdmin = await privateKey('//Bob');
+ const newAdmin = privateKey('//Bob');
const newAdminCross = helper.ethCrossAccount.fromKeyringPair(newAdmin);
await collectionEvm.methods.addCollectionAdminCross(newAdminCross).send();
tests/src/eth/fungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -149,7 +149,7 @@
});
itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const sender = await helper.eth.createAccountWithBalance(alice, 100n);
const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);
@@ -261,7 +261,7 @@
});
itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const sender = await helper.eth.createAccountWithBalance(alice, 100n);
const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);
@@ -455,7 +455,7 @@
});
itEth('Events emitted for transferFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const sender = await helper.eth.createAccountWithBalance(alice, 100n);
const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -247,10 +247,10 @@
});
itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = await privateKey('//Bob');
+ const owner = privateKey('//Bob');
const spender = await helper.eth.createAccountWithBalance(alice, 100n);
const token = await collection.mintToken(alice, {Substrate: owner.address});
@@ -277,11 +277,11 @@
});
itEth('Can perform approveCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
const owner = await helper.eth.createAccountWithBalance(alice, 100n);
- const receiver = await privateKey('//Charlie');
+ const receiver = privateKey('//Charlie');
const token = await collection.mintToken(alice, {Ethereum: owner});
@@ -410,12 +410,12 @@
});
itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = await privateKey('//Bob');
+ const owner = privateKey('//Bob');
const spender = await helper.eth.createAccountWithBalance(alice, 100n);
- const receiver = await privateKey('//Charlie');
+ const receiver = privateKey('//Charlie');
const token = await collection.mintToken(alice, {Substrate: owner.address});
tests/src/eth/reFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -228,7 +228,7 @@
});
itEth('Can perform burnFrom()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
const owner = await helper.eth.createAccountWithBalance(alice, 100n);
@@ -262,10 +262,10 @@
});
itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = await privateKey('//Bob');
+ const owner = privateKey('//Bob');
const spender = await helper.eth.createAccountWithBalance(alice, 100n);
const token = await collection.mintToken(alice, 100n, {Substrate: owner.address});
@@ -295,12 +295,12 @@
});
itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
- const alice = await privateKey('//Alice');
+ const alice = privateKey('//Alice');
const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = await privateKey('//Bob');
+ const owner = privateKey('//Bob');
const spender = await helper.eth.createAccountWithBalance(alice, 100n);
- const receiver = await privateKey('//Charlie');
+ const receiver = privateKey('//Charlie');
const token = await collection.mintToken(alice, 100n, {Substrate: owner.address});
tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -381,6 +381,46 @@
}
}
+export class EthCrossAccountGroup extends EthGroupBase {
+ fromAddress(address: TEthereumAccount): TEthCrossAccount {
+ return {
+ 0: address,
+ 1: '0',
+ field_0: address,
+ field_1: '0',
+ };
+ }
+
+ fromKeyringPair(keyring: IKeyringPair): TEthCrossAccount {
+ return {
+ 0: '0x0000000000000000000000000000000000000000',
+ 1: keyring.addressRaw,
+ field_0: '0x0000000000000000000000000000000000000000',
+ field_1: keyring.addressRaw,
+ };
+ }
+}
+
+export class EthCrossAccountGroup extends EthGroupBase {
+ fromAddress(address: TEthereumAccount): TEthCrossAccount {
+ return {
+ 0: address,
+ 1: '0',
+ field_0: address,
+ field_1: '0',
+ };
+ }
+
+ fromKeyringPair(keyring: IKeyringPair): TEthCrossAccount {
+ return {
+ 0: '0x0000000000000000000000000000000000000000',
+ 1: keyring.addressRaw,
+ field_0: '0x0000000000000000000000000000000000000000',
+ field_1: keyring.addressRaw,
+ };
+ }
+}
+
export class EthUniqueHelper extends DevUniqueHelper {
web3: Web3 | null = null;
web3Provider: WebsocketProvider | null = null;