difftreelog
feat Using EthCrossAccount in appropriate functions
in: master
11 files changed
crates/evm-coder/src/abi.rsdiffbeforeafterboth--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -450,7 +450,7 @@
}
}
-impl AbiWrite for &EthCrossAccount {
+impl AbiWrite for EthCrossAccount {
fn abi_write(&self, writer: &mut AbiWriter) {
self.eth.abi_write(writer);
self.sub.abi_write(writer);
crates/evm-coder/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -218,7 +218,7 @@
}
}
- #[derive(Debug)]
+ #[derive(Debug, Default)]
pub struct EthCrossAccount {
pub(crate) eth: address,
pub(crate) sub: uint256,
crates/evm-coder/src/solidity.rsdiffbeforeafterboth--- a/crates/evm-coder/src/solidity.rs
+++ b/crates/evm-coder/src/solidity.rs
@@ -203,7 +203,7 @@
}
fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {
- write!(writer, "{}(", tc.collect_tuple::<Self>())?;
+ write!(writer, "{}(", tc.collect_struct::<Self>())?;
address::solidity_default(writer, tc)?;
write!(writer, ",")?;
uint256::solidity_default(writer, tc)?;
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -231,13 +231,13 @@
fn set_collection_sponsor_cross(
&mut self,
caller: caller,
- sponsor: (address, uint256),
+ sponsor: EthCrossAccount,
) -> Result<void> {
self.consume_store_reads_and_writes(1, 1)?;
check_is_owner_or_admin(caller, self)?;
- let sponsor = convert_tuple_to_cross_account::<T>(sponsor)?;
+ let sponsor = sponsor.into_sub_cross_account::<T>()?;
self.set_sponsor(sponsor.as_sub().clone())
.map_err(dispatch_to_evm::<T>)?;
save(self)
@@ -388,12 +388,12 @@
fn add_collection_admin_cross(
&mut self,
caller: caller,
- new_admin: (address, uint256),
+ new_admin: EthCrossAccount,
) -> Result<void> {
self.consume_store_writes(2)?;
let caller = T::CrossAccountId::from_eth(caller);
- let new_admin = convert_tuple_to_cross_account::<T>(new_admin)?;
+ let new_admin = new_admin.into_sub_cross_account::<T>()?;
<Pallet<T>>::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -403,12 +403,12 @@
fn remove_collection_admin_cross(
&mut self,
caller: caller,
- admin: (address, uint256),
+ admin: EthCrossAccount,
) -> Result<void> {
self.consume_store_writes(2)?;
let caller = T::CrossAccountId::from_eth(caller);
- let admin = convert_tuple_to_cross_account::<T>(admin)?;
+ let admin = admin.into_sub_cross_account::<T>()?;
<Pallet<T>>::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -566,12 +566,12 @@
fn add_to_collection_allow_list_cross(
&mut self,
caller: caller,
- user: (address, uint256),
+ user: EthCrossAccount,
) -> Result<void> {
self.consume_store_writes(1)?;
let caller = T::CrossAccountId::from_eth(caller);
- let user = convert_tuple_to_cross_account::<T>(user)?;
+ let user = user.into_sub_cross_account::<T>()?;
Pallet::<T>::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -594,12 +594,12 @@
fn remove_from_collection_allow_list_cross(
&mut self,
caller: caller,
- user: (address, uint256),
+ user: EthCrossAccount,
) -> Result<void> {
self.consume_store_writes(1)?;
let caller = T::CrossAccountId::from_eth(caller);
- let user = convert_tuple_to_cross_account::<T>(user)?;
+ let user = user.into_sub_cross_account::<T>()?;
Pallet::<T>::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -639,8 +639,8 @@
///
/// @param user User cross account to verify
/// @return "true" if account is the owner or admin
- fn is_owner_or_admin_cross(&self, user: (address, uint256)) -> Result<bool> {
- let user = convert_tuple_to_cross_account::<T>(user)?;
+ fn is_owner_or_admin_cross(&self, user: EthCrossAccount) -> Result<bool> {
+ let user = user.into_sub_cross_account::<T>()?;
Ok(self.is_owner_or_admin(&user))
}
@@ -660,8 +660,8 @@
///
/// @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>(
+ fn collection_owner(&self) -> Result<EthCrossAccount> {
+ Ok(EthCrossAccount::from_sub_cross_account::<T>(
&T::CrossAccountId::from_sub(self.owner.clone()),
))
}
@@ -684,9 +684,9 @@
///
/// @return Vector of tuples with admins address and his substrate mirror.
/// If address is canonical then substrate mirror is zero and vice versa.
- fn collection_admins(&self) -> Result<Vec<(address, uint256)>> {
+ fn collection_admins(&self) -> Result<Vec<EthCrossAccount>> {
let result = crate::IsAdmin::<T>::iter_prefix((self.id,))
- .map(|(admin, _)| crate::eth::convert_cross_account_to_tuple::<T>(&admin))
+ .map(|(admin, _)| EthCrossAccount::from_sub_cross_account::<T>(&admin))
.collect();
Ok(result)
}
@@ -695,11 +695,11 @@
///
/// @dev Owner can be changed only by current owner
/// @param newOwner new owner cross account
- fn set_owner_cross(&mut self, caller: caller, new_owner: (address, uint256)) -> Result<void> {
+ fn set_owner_cross(&mut self, caller: caller, new_owner: EthCrossAccount) -> Result<void> {
self.consume_store_writes(1)?;
let caller = T::CrossAccountId::from_eth(caller);
- let new_owner = convert_tuple_to_cross_account::<T>(new_owner)?;
+ let new_owner = new_owner.into_sub_cross_account::<T>()?;
self.set_owner_internal(caller, new_owner)
.map_err(dispatch_to_evm::<T>)
}
pallets/fungible/src/erc.rsdiffbeforeafterboth--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -167,11 +167,11 @@
fn approve_cross(
&mut self,
caller: caller,
- spender: (address, uint256),
+ spender: EthCrossAccount,
amount: uint256,
) -> Result<bool> {
let caller = T::CrossAccountId::from_eth(caller);
- let spender = convert_tuple_to_cross_account::<T>(spender)?;
+ let spender = spender.into_sub_cross_account::<T>()?;
let amount = amount.try_into().map_err(|_| "amount overflow")?;
<Pallet<T>>::set_allowance(self, &caller, &spender, amount)
@@ -207,11 +207,11 @@
fn burn_from_cross(
&mut self,
caller: caller,
- from: (address, uint256),
+ from: EthCrossAccount,
amount: uint256,
) -> Result<bool> {
let caller = T::CrossAccountId::from_eth(caller);
- let from = convert_tuple_to_cross_account::<T>(from)?;
+ let from = from.into_sub_cross_account::<T>()?;
let amount = amount.try_into().map_err(|_| "amount overflow")?;
let budget = self
.recorder
@@ -249,13 +249,13 @@
fn transfer_from_cross(
&mut self,
caller: caller,
- from: (address, uint256),
- to: (address, uint256),
+ from: EthCrossAccount,
+ to: EthCrossAccount,
amount: uint256,
) -> Result<bool> {
let caller = T::CrossAccountId::from_eth(caller);
- let from = convert_tuple_to_cross_account::<T>(from)?;
- let to = convert_tuple_to_cross_account::<T>(to)?;
+ let from = from.into_sub_cross_account::<T>()?;
+ let to = to.into_sub_cross_account::<T>()?;
let amount = amount.try_into().map_err(|_| "amount overflow")?;
let budget = self
.recorder
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -684,11 +684,11 @@
fn approve_cross(
&mut self,
caller: caller,
- approved: (address, uint256),
+ approved: EthCrossAccount,
token_id: uint256,
) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
- let approved = convert_tuple_to_cross_account::<T>(approved)?;
+ let approved = approved.into_sub_cross_account::<T>()?;
let token = token_id.try_into()?;
<Pallet<T>>::set_allowance(self, &caller, token, Some(&approved))
@@ -770,11 +770,11 @@
fn burn_from_cross(
&mut self,
caller: caller,
- from: (address, uint256),
+ from: EthCrossAccount,
token_id: uint256,
) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
- let from = convert_tuple_to_cross_account::<T>(from)?;
+ let from = from.into_sub_cross_account::<T>()?;
let token = token_id.try_into()?;
let budget = self
.recorder
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -734,23 +734,23 @@
fn transfer_from_cross(
&mut self,
caller: caller,
- from: (address, uint256),
- to: (address, uint256),
+ from: EthCrossAccount,
+ to: EthCrossAccount,
token_id: uint256,
) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
- // let from = convert_tuple_to_cross_account::<T>(from)?;
- // let to = convert_tuple_to_cross_account::<T>(to)?;
- // let token_id = token_id.try_into()?;
- // let budget = self
- // .recorder
- // .weight_calls_budget(<StructureWeight<T>>::find_parent());
+ let from = from.into_sub_cross_account::<T>()?;
+ let to = to.into_sub_cross_account::<T>()?;
+ let token_id = token_id.try_into()?;
+ let budget = self
+ .recorder
+ .weight_calls_budget(<StructureWeight<T>>::find_parent());
- // let balance = balance(self, token_id, &from)?;
- // ensure_single_owner(self, token_id, balance)?;
+ let balance = balance(self, token_id, &from)?;
+ ensure_single_owner(self, token_id, balance)?;
- // Pallet::<T>::transfer_from(self, &caller, &from, &to, token_id, balance, &budget)
- // .map_err(dispatch_to_evm::<T>)?;
+ Pallet::<T>::transfer_from(self, &caller, &from, &to, token_id, balance, &budget)
+ .map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -789,11 +789,11 @@
fn burn_from_cross(
&mut self,
caller: caller,
- from: (address, uint256),
+ from: EthCrossAccount,
token_id: uint256,
) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
- let from = convert_tuple_to_cross_account::<T>(from)?;
+ let from = from.into_sub_cross_account::<T>()?;
let token = token_id.try_into()?;
let budget = self
.recorder
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionAdmin.test.ts
+++ b/tests/src/eth/collectionAdmin.test.ts
@@ -94,25 +94,6 @@
await collectionEvm.methods.addCollectionAdmin(newAdmin).send();
expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.true;
});
-
- itEth.skip('Check adminlist', async ({helper, privateKey}) => {
- 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 admin1 = helper.eth.createAccount();
- const admin2 = privateKey('admin');
- await collectionEvm.methods.addCollectionAdmin(admin1).send();
- await collectionEvm.methods.addCollectionAdminSubstrate(admin2.addressRaw).send();
-
- const adminListRpc = await helper.collection.getAdmins(collectionId);
- let adminListEth = await collectionEvm.methods.collectionAdmins().call();
- adminListEth = adminListEth.map((element: IEthCrossAccountId) => {
- return helper.address.convertCrossAccountFromEthCrossAcoount(element);
- });
- expect(adminListRpc).to.be.like(adminListEth);
- });
itEth('(!negative tests!) Add admin by ADMIN is not allowed', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -409,7 +409,7 @@
expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
});
- itEth.only('Can perform transferFromCross()', async ({helper, privateKey}) => {
+ itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
const alice = privateKey('//Alice');
const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
tests/src/util/playgrounds/types.tsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// SPDX-License-Identifier: Apache-2.034import {IKeyringPair} from '@polkadot/types/types';56export interface IEvent {7 section: string;8 method: string;9 index: [number, number] | string;10 data: any[];11 phase: {applyExtrinsic: number} | 'Initialization',12}1314export interface ITransactionResult {15 status: 'Fail' | 'Success';16 result: {17 dispatchError: any,18 events: {19 phase: any, // {ApplyExtrinsic: number} | 'Initialization',20 event: IEvent;21 }[];22 },23 moduleError?: string;24}2526export interface ISubscribeBlockEventsData {27 number: number;28 hash: string;29 timestamp: number; 30 events: IEvent[];31}3233export interface ILogger {34 log: (msg: any, level?: string) => void;35 level: {36 ERROR: 'ERROR';37 WARNING: 'WARNING';38 INFO: 'INFO';39 [key: string]: string;40 }41}4243export interface IUniqueHelperLog {44 executedAt: number;45 executionTime: number;46 type: 'extrinsic' | 'rpc';47 status: 'Fail' | 'Success';48 call: string;49 params: any[];50 moduleError?: string;51 dispatchError?: any;52 events?: any;53}5455export interface IApiListeners {56 connected?: (...args: any[]) => any;57 disconnected?: (...args: any[]) => any;58 error?: (...args: any[]) => any;59 ready?: (...args: any[]) => any; 60 decorated?: (...args: any[]) => any;61}6263export interface ICrossAccountId {64 Substrate?: TSubstrateAccount;65 Ethereum?: TEthereumAccount;66}6768export interface ICrossAccountIdLower {69 substrate?: TSubstrateAccount;70 ethereum?: TEthereumAccount;71}7273export interface IEthCrossAccountId {74 0: TEthereumAccount;75 1: TSubstrateAccount;76 field_0: TEthereumAccount;77 field_1: TSubstrateAccount;78}7980export interface ICollectionLimits {81 accountTokenOwnershipLimit?: number | null;82 sponsoredDataSize?: number | null;83 sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null;84 tokenLimit?: number | null;85 sponsorTransferTimeout?: number | null;86 sponsorApproveTimeout?: number | null;87 ownerCanTransfer?: boolean | null;88 ownerCanDestroy?: boolean | null;89 transfersEnabled?: boolean | null;90}9192export interface INestingPermissions {93 tokenOwner?: boolean;94 collectionAdmin?: boolean;95 restricted?: number[] | null;96}9798export interface ICollectionPermissions {99 access?: 'Normal' | 'AllowList';100 mintMode?: boolean;101 nesting?: INestingPermissions;102}103104export interface IProperty {105 key: string;106 value?: string;107}108109export interface ITokenPropertyPermission {110 key: string;111 permission: {112 mutable?: boolean;113 tokenOwner?: boolean;114 collectionAdmin?: boolean;115 }116}117118export interface IToken {119 collectionId: number;120 tokenId: number;121}122123export interface IBlock {124 extrinsics: IExtrinsic[]125 header: {126 parentHash: string,127 number: number,128 };129}130131export interface IExtrinsic {132 isSigned: boolean,133 method: {134 method: string,135 section: string,136 args: any[]137 }138}139140export interface ICollectionCreationOptions {141 name?: string | number[];142 description?: string | number[];143 tokenPrefix?: string | number[];144 mode?: {145 nft?: null;146 refungible?: null;147 fungible?: number;148 }149 permissions?: ICollectionPermissions;150 properties?: IProperty[];151 tokenPropertyPermissions?: ITokenPropertyPermission[];152 limits?: ICollectionLimits;153 pendingSponsor?: TSubstrateAccount;154}155156export interface IChainProperties {157 ss58Format: number;158 tokenDecimals: number[];159 tokenSymbol: string[]160}161162export interface ISubstrateBalance {163 free: bigint,164 reserved: bigint,165 miscFrozen: bigint,166 feeFrozen: bigint167}168169export interface IStakingInfo {170 block: bigint,171 amount: bigint,172}173174export interface ISchedulerOptions {175 priority?: number,176 periodic?: {177 period: number,178 repetitions: number,179 },180}181182export interface IForeignAssetMetadata {183 name?: number | Uint8Array,184 symbol?: string,185 decimals?: number,186 minimalBalance?: bigint,187}188189export interface MoonbeamAssetInfo {190 location: any,191 metadata: {192 name: string,193 symbol: string,194 decimals: number,195 isFrozen: boolean,196 minimalBalance: bigint,197 },198 existentialDeposit: bigint,199 isSufficient: boolean,200 unitsPerSecond: bigint,201 numAssetsWeightHint: number,202}203204export interface AcalaAssetMetadata {205 name: string,206 symbol: string,207 decimals: number,208 minimalBalance: bigint,209}210211export interface DemocracyStandardAccountVote {212 balance: bigint,213 vote: {214 aye: boolean,215 conviction: number,216 },217}218219export type TSubstrateAccount = string;220export type TEthereumAccount = string;221export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';222export type TUniqueNetworks = 'opal' | 'quartz' | 'unique';223export type TSiblingNetworkds = 'moonbeam' | 'moonriver' | 'acala' | 'karura' | 'westmint';224export type TRelayNetworks = 'rococo' | 'westend';225export type TNetworks = TUniqueNetworks | TSiblingNetworkds | TRelayNetworks;226export type TSigner = IKeyringPair; // | 'string'227export type TCollectionMode = 'nft' | 'rft' | 'ft';1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// SPDX-License-Identifier: Apache-2.034import {IKeyringPair} from '@polkadot/types/types';56export interface IEvent {7 section: string;8 method: string;9 index: [number, number] | string;10 data: any[];11 phase: {applyExtrinsic: number} | 'Initialization',12}1314export interface ITransactionResult {15 status: 'Fail' | 'Success';16 result: {17 dispatchError: any,18 events: {19 phase: any, // {ApplyExtrinsic: number} | 'Initialization',20 event: IEvent;21 }[];22 },23 moduleError?: string;24}2526export interface ISubscribeBlockEventsData {27 number: number;28 hash: string;29 timestamp: number; 30 events: IEvent[];31}3233export interface ILogger {34 log: (msg: any, level?: string) => void;35 level: {36 ERROR: 'ERROR';37 WARNING: 'WARNING';38 INFO: 'INFO';39 [key: string]: string;40 }41}4243export interface IUniqueHelperLog {44 executedAt: number;45 executionTime: number;46 type: 'extrinsic' | 'rpc';47 status: 'Fail' | 'Success';48 call: string;49 params: any[];50 moduleError?: string;51 dispatchError?: any;52 events?: any;53}5455export interface IApiListeners {56 connected?: (...args: any[]) => any;57 disconnected?: (...args: any[]) => any;58 error?: (...args: any[]) => any;59 ready?: (...args: any[]) => any; 60 decorated?: (...args: any[]) => any;61}6263export interface ICrossAccountId {64 Substrate?: TSubstrateAccount;65 Ethereum?: TEthereumAccount;66}6768export interface ICrossAccountIdLower {69 substrate?: TSubstrateAccount;70 ethereum?: TEthereumAccount;71}7273export interface IEthCrossAccountId {74 0: TEthereumAccount;75 1: TSubstrateAccount;76 eth: TEthereumAccount;77 sub: TSubstrateAccount;78}7980export interface ICollectionLimits {81 accountTokenOwnershipLimit?: number | null;82 sponsoredDataSize?: number | null;83 sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null;84 tokenLimit?: number | null;85 sponsorTransferTimeout?: number | null;86 sponsorApproveTimeout?: number | null;87 ownerCanTransfer?: boolean | null;88 ownerCanDestroy?: boolean | null;89 transfersEnabled?: boolean | null;90}9192export interface INestingPermissions {93 tokenOwner?: boolean;94 collectionAdmin?: boolean;95 restricted?: number[] | null;96}9798export interface ICollectionPermissions {99 access?: 'Normal' | 'AllowList';100 mintMode?: boolean;101 nesting?: INestingPermissions;102}103104export interface IProperty {105 key: string;106 value?: string;107}108109export interface ITokenPropertyPermission {110 key: string;111 permission: {112 mutable?: boolean;113 tokenOwner?: boolean;114 collectionAdmin?: boolean;115 }116}117118export interface IToken {119 collectionId: number;120 tokenId: number;121}122123export interface IBlock {124 extrinsics: IExtrinsic[]125 header: {126 parentHash: string,127 number: number,128 };129}130131export interface IExtrinsic {132 isSigned: boolean,133 method: {134 method: string,135 section: string,136 args: any[]137 }138}139140export interface ICollectionCreationOptions {141 name?: string | number[];142 description?: string | number[];143 tokenPrefix?: string | number[];144 mode?: {145 nft?: null;146 refungible?: null;147 fungible?: number;148 }149 permissions?: ICollectionPermissions;150 properties?: IProperty[];151 tokenPropertyPermissions?: ITokenPropertyPermission[];152 limits?: ICollectionLimits;153 pendingSponsor?: TSubstrateAccount;154}155156export interface IChainProperties {157 ss58Format: number;158 tokenDecimals: number[];159 tokenSymbol: string[]160}161162export interface ISubstrateBalance {163 free: bigint,164 reserved: bigint,165 miscFrozen: bigint,166 feeFrozen: bigint167}168169export interface IStakingInfo {170 block: bigint,171 amount: bigint,172}173174export interface ISchedulerOptions {175 priority?: number,176 periodic?: {177 period: number,178 repetitions: number,179 },180}181182export interface IForeignAssetMetadata {183 name?: number | Uint8Array,184 symbol?: string,185 decimals?: number,186 minimalBalance?: bigint,187}188189export interface MoonbeamAssetInfo {190 location: any,191 metadata: {192 name: string,193 symbol: string,194 decimals: number,195 isFrozen: boolean,196 minimalBalance: bigint,197 },198 existentialDeposit: bigint,199 isSufficient: boolean,200 unitsPerSecond: bigint,201 numAssetsWeightHint: number,202}203204export interface AcalaAssetMetadata {205 name: string,206 symbol: string,207 decimals: number,208 minimalBalance: bigint,209}210211export interface DemocracyStandardAccountVote {212 balance: bigint,213 vote: {214 aye: boolean,215 conviction: number,216 },217}218219export type TSubstrateAccount = string;220export type TEthereumAccount = string;221export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';222export type TUniqueNetworks = 'opal' | 'quartz' | 'unique';223export type TSiblingNetworkds = 'moonbeam' | 'moonriver' | 'acala' | 'karura' | 'westmint';224export type TRelayNetworks = 'rococo' | 'westend';225export type TNetworks = TUniqueNetworks | TSiblingNetworkds | TRelayNetworks;226export type TSigner = IKeyringPair; // | 'string'227export type TCollectionMode = 'nft' | 'rft' | 'ft';tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -2430,11 +2430,11 @@
* @returns substrate cross account id
*/
convertCrossAccountFromEthCrossAcoount(ethCrossAccount: IEthCrossAccountId): ICrossAccountId {
- if (ethCrossAccount.field_1 === '0') {
- return {Ethereum: ethCrossAccount.field_0.toLocaleLowerCase()};
+ if (ethCrossAccount.sub === '0') {
+ return {Ethereum: ethCrossAccount.eth.toLocaleLowerCase()};
}
- const ss58 = this.restoreCrossAccountFromBigInt(BigInt(ethCrossAccount.field_1));
+ const ss58 = this.restoreCrossAccountFromBigInt(BigInt(ethCrossAccount.sub));
return {Substrate: ss58};
}