From 7b7a0a81745536b79cd2e538177ebd487c060bff Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Thu, 28 Dec 2023 21:07:16 +1300 Subject: [PATCH] apply unlimited weight to precompile calls --- .vscode/settings.json | 4 ++-- .../builder/src/contract/contracts/Xtokens/Xtokens.ts | 8 ++++---- packages/config/src/configs/moonbaseAlpha.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 26ef47ff..31aad05b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -38,7 +38,7 @@ "editor.formatOnSaveMode": "file", "typescript.preferences.importModuleSpecifier": "relative", "editor.codeActionsOnSave": { - "source.organizeImports": true, - "source.fixAll.eslint": true + "source.organizeImports": "explicit", + "source.fixAll.eslint": "explicit" } } diff --git a/packages/builder/src/contract/contracts/Xtokens/Xtokens.ts b/packages/builder/src/contract/contracts/Xtokens/Xtokens.ts index 56afd29e..6fee58d5 100644 --- a/packages/builder/src/contract/contracts/Xtokens/Xtokens.ts +++ b/packages/builder/src/contract/contracts/Xtokens/Xtokens.ts @@ -6,9 +6,11 @@ import { decodeAddress } from '@polkadot/util-crypto'; import { ContractConfigBuilder } from '../../ContractBuilder.interfaces'; import { ContractConfig } from '../../ContractConfig'; +const U_64_MAX = 18446744073709551615n; + export function Xtokens() { return { - transfer: (weight = 4_000_000_000): ContractConfigBuilder => ({ + transfer: (weight = U_64_MAX): ContractConfigBuilder => ({ build: ({ address, amount, asset, destination }) => new ContractConfig({ args: [ @@ -21,9 +23,7 @@ export function Xtokens() { module: 'Xtokens', }), }), - transferMultiCurrencies: ( - weight = 4_000_000_000, - ): ContractConfigBuilder => ({ + transferMultiCurrencies: (weight = U_64_MAX): ContractConfigBuilder => ({ build: ({ address, amount, asset, destination, fee, feeAsset }) => new ContractConfig({ args: [ diff --git a/packages/config/src/configs/moonbaseAlpha.ts b/packages/config/src/configs/moonbaseAlpha.ts index dc0d36c9..dea9b312 100644 --- a/packages/config/src/configs/moonbaseAlpha.ts +++ b/packages/config/src/configs/moonbaseAlpha.ts @@ -71,7 +71,7 @@ export const moonbaseAlphaConfig = new ChainConfig({ contract: ContractBuilder().Xtokens().transfer(), destination: pendulumAlphanet, destinationFee: { - amount: 0.0000001, // TODO + amount: 0.0000001, asset: dev, balance: BalanceBuilder().substrate().system().account(), }, @@ -123,7 +123,7 @@ export const moonbaseAlphaConfig = new ChainConfig({ contract: ContractBuilder().Xtokens().transfer(), destination: pendulumAlphanet, destinationFee: { - amount: 0.1, // TODO + amount: 0.001, asset: ampe, balance: BalanceBuilder().substrate().assets().account(), },