@argonprotocol/testing 1.5.2-dev.9c5eb2c8 → 1.5.2-dev.cdfb6ab4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +90 -45
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +11 -36
- package/lib/index.d.ts +11 -36
- package/lib/index.js +95 -47
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _argonprotocol_mainchain from '@argonprotocol/mainchain';
|
|
|
2
2
|
import { KeyringPair, ArgonClient, GenericEvent, SubmittableExtrinsic, EthereumReceipt, EthereumBeaconHeaderDetailsResponse, EthereumBeaconBlockResponse, EvmContracts, IArgonQueryable } from '@argonprotocol/mainchain';
|
|
3
3
|
import { Client } from 'pg';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
|
-
import { Hex, createWalletClient, defineChain, Address, ContractFunctionArgs } from 'viem';
|
|
5
|
+
import { Hex, createWalletClient, defineChain, Address, ContractFunctionArgs, createPublicClient } from 'viem';
|
|
6
6
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
7
|
import * as _polkadot_types_codec from '@polkadot/types-codec';
|
|
8
8
|
|
|
@@ -218,7 +218,7 @@ declare function waitForFinalizedBeaconExecutionAtOrAbove(ethereum: TestEthereum
|
|
|
218
218
|
block: EthereumBeaconBlockResponse;
|
|
219
219
|
}>;
|
|
220
220
|
declare function mineLaterExecutionAnchorReceipt(walletClient: Pick<ReturnType<typeof createWalletClient>, 'sendTransaction'>, chain: ReturnType<typeof defineChain>, ethereum: TestEthereum, account: ReturnType<typeof privateKeyToAccount>, minimumBlockNumber: bigint): Promise<viem.TransactionReceipt>;
|
|
221
|
-
declare function waitForExecutionReceipt(ethereum: TestEthereum, transactionHash: Hex): Promise<EthereumReceipt>;
|
|
221
|
+
declare function waitForExecutionReceipt(ethereum: Pick<TestEthereum, 'callExecution'>, transactionHash: Hex): Promise<EthereumReceipt>;
|
|
222
222
|
declare function syncEthereumVerifierUntilAnchorCovers(mainchainClient: ArgonClient, relayer: KeyringPair, beaconApiUrl: string, minimumExecutionBlockNumber: bigint): Promise<void>;
|
|
223
223
|
declare function toArgonKeccakSignature(signature: Hex): Hex;
|
|
224
224
|
declare function toEvmRecoverableSignature(signature: Hex): Hex;
|
|
@@ -248,20 +248,7 @@ declare function getReadyEthereumGatewayUpdates(client: IArgonQueryable, gateway
|
|
|
248
248
|
|
|
249
249
|
type DeployerAccount = ReturnType<typeof privateKeyToAccount>;
|
|
250
250
|
type EthereumChain = ReturnType<typeof defineChain>;
|
|
251
|
-
type EthereumPublicClient =
|
|
252
|
-
getBalance: (args: {
|
|
253
|
-
address: Hex;
|
|
254
|
-
}) => Promise<bigint>;
|
|
255
|
-
getBlock: (...args: any[]) => Promise<any>;
|
|
256
|
-
getBlockNumber: () => Promise<bigint>;
|
|
257
|
-
readContract: (...args: any[]) => Promise<unknown>;
|
|
258
|
-
waitForTransactionReceipt: (args: {
|
|
259
|
-
hash: Hex;
|
|
260
|
-
}) => Promise<{
|
|
261
|
-
status: string;
|
|
262
|
-
blockNumber: bigint;
|
|
263
|
-
}>;
|
|
264
|
-
};
|
|
251
|
+
type EthereumPublicClient = Pick<ReturnType<typeof createPublicClient>, 'getBalance' | 'getBlock' | 'getBlockNumber' | 'readContract' | 'estimateGas'>;
|
|
265
252
|
type EthereumWalletClient = {
|
|
266
253
|
sendTransaction: (...args: any[]) => Promise<Hex>;
|
|
267
254
|
writeContract: (...args: any[]) => Promise<Hex>;
|
|
@@ -302,9 +289,9 @@ declare class EthereumProofE2eHarness {
|
|
|
302
289
|
submit(tx: SubmittableExtrinsic, signer: KeyringPair): Promise<TestTxResult>;
|
|
303
290
|
sudoSubmit(tx: SubmittableExtrinsic): Promise<TestTxResult>;
|
|
304
291
|
syncVerifierThrough(minimumExecutionBlockNumber: bigint): Promise<void>;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
292
|
+
proveGatewayActivities(gatewayAddress: Hex, throughExecutionBlockNumber: bigint): Promise<{
|
|
293
|
+
payloads: _argonprotocol_mainchain.EthereumGatewayActivityStorageProofPayload[];
|
|
294
|
+
results: TestTxResult[];
|
|
308
295
|
}>;
|
|
309
296
|
configureEthereumRuntime(gateway: TestMintingGateway, mode: RuntimeSetupMode): Promise<{
|
|
310
297
|
result: TestTxResult;
|
|
@@ -331,16 +318,10 @@ declare class TestMintingGateway {
|
|
|
331
318
|
forceUpdateActiveCouncil(replacementCouncil: {
|
|
332
319
|
signers: Hex[];
|
|
333
320
|
weights: bigint[];
|
|
334
|
-
}, nextMicrogonsPerArgonot: bigint): Promise<
|
|
335
|
-
|
|
336
|
-
blockNumber: bigint;
|
|
337
|
-
}>;
|
|
338
|
-
relayReadyApprovals(batch: Awaited<ReturnType<typeof getReadyEthereumGatewayUpdates>>, operatorAddress: string): Promise<{
|
|
339
|
-
status: string;
|
|
340
|
-
blockNumber: bigint;
|
|
341
|
-
}>;
|
|
321
|
+
}, nextMicrogonsPerArgonot: bigint): Promise<viem.TransactionReceipt>;
|
|
322
|
+
relayReadyApprovals(batch: Awaited<ReturnType<typeof getReadyEthereumGatewayUpdates>>, operatorAddress: string): Promise<viem.TransactionReceipt>;
|
|
342
323
|
argonApprovalsNonce(): Promise<bigint>;
|
|
343
|
-
globalIssuanceCouncil(): Promise<[
|
|
324
|
+
globalIssuanceCouncil(): Promise<readonly [bigint, bigint, `0x${string}`, bigint]>;
|
|
344
325
|
authorityCollateral(signingKey: Hex): Promise<[bigint, bigint]>;
|
|
345
326
|
finalizeTransferOut(args: {
|
|
346
327
|
transferRequest: {
|
|
@@ -356,16 +337,10 @@ declare class TestMintingGateway {
|
|
|
356
337
|
};
|
|
357
338
|
collateralizationSignature: Hex;
|
|
358
339
|
micronotCollateral: bigint;
|
|
359
|
-
}): Promise<
|
|
360
|
-
status: string;
|
|
361
|
-
blockNumber: bigint;
|
|
362
|
-
}>;
|
|
340
|
+
}): Promise<viem.TransactionReceipt>;
|
|
363
341
|
isFinalizedTransferOut(transferRequest: Parameters<typeof EvmContracts.hashMintingGatewayTransferOutOfArgonRequest>[0]): Promise<boolean>;
|
|
364
342
|
argonBalance(address: Hex): Promise<bigint>;
|
|
365
|
-
fundExecutionAccount(address: Hex, value: bigint): Promise<
|
|
366
|
-
status: string;
|
|
367
|
-
blockNumber: bigint;
|
|
368
|
-
}>;
|
|
343
|
+
fundExecutionAccount(address: Hex, value: bigint): Promise<viem.TransactionReceipt>;
|
|
369
344
|
}
|
|
370
345
|
declare class TestMintingAuthorityActor {
|
|
371
346
|
readonly harness: EthereumProofE2eHarness;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _argonprotocol_mainchain from '@argonprotocol/mainchain';
|
|
|
2
2
|
import { KeyringPair, ArgonClient, GenericEvent, SubmittableExtrinsic, EthereumReceipt, EthereumBeaconHeaderDetailsResponse, EthereumBeaconBlockResponse, EvmContracts, IArgonQueryable } from '@argonprotocol/mainchain';
|
|
3
3
|
import { Client } from 'pg';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
|
-
import { Hex, createWalletClient, defineChain, Address, ContractFunctionArgs } from 'viem';
|
|
5
|
+
import { Hex, createWalletClient, defineChain, Address, ContractFunctionArgs, createPublicClient } from 'viem';
|
|
6
6
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
7
|
import * as _polkadot_types_codec from '@polkadot/types-codec';
|
|
8
8
|
|
|
@@ -218,7 +218,7 @@ declare function waitForFinalizedBeaconExecutionAtOrAbove(ethereum: TestEthereum
|
|
|
218
218
|
block: EthereumBeaconBlockResponse;
|
|
219
219
|
}>;
|
|
220
220
|
declare function mineLaterExecutionAnchorReceipt(walletClient: Pick<ReturnType<typeof createWalletClient>, 'sendTransaction'>, chain: ReturnType<typeof defineChain>, ethereum: TestEthereum, account: ReturnType<typeof privateKeyToAccount>, minimumBlockNumber: bigint): Promise<viem.TransactionReceipt>;
|
|
221
|
-
declare function waitForExecutionReceipt(ethereum: TestEthereum, transactionHash: Hex): Promise<EthereumReceipt>;
|
|
221
|
+
declare function waitForExecutionReceipt(ethereum: Pick<TestEthereum, 'callExecution'>, transactionHash: Hex): Promise<EthereumReceipt>;
|
|
222
222
|
declare function syncEthereumVerifierUntilAnchorCovers(mainchainClient: ArgonClient, relayer: KeyringPair, beaconApiUrl: string, minimumExecutionBlockNumber: bigint): Promise<void>;
|
|
223
223
|
declare function toArgonKeccakSignature(signature: Hex): Hex;
|
|
224
224
|
declare function toEvmRecoverableSignature(signature: Hex): Hex;
|
|
@@ -248,20 +248,7 @@ declare function getReadyEthereumGatewayUpdates(client: IArgonQueryable, gateway
|
|
|
248
248
|
|
|
249
249
|
type DeployerAccount = ReturnType<typeof privateKeyToAccount>;
|
|
250
250
|
type EthereumChain = ReturnType<typeof defineChain>;
|
|
251
|
-
type EthereumPublicClient =
|
|
252
|
-
getBalance: (args: {
|
|
253
|
-
address: Hex;
|
|
254
|
-
}) => Promise<bigint>;
|
|
255
|
-
getBlock: (...args: any[]) => Promise<any>;
|
|
256
|
-
getBlockNumber: () => Promise<bigint>;
|
|
257
|
-
readContract: (...args: any[]) => Promise<unknown>;
|
|
258
|
-
waitForTransactionReceipt: (args: {
|
|
259
|
-
hash: Hex;
|
|
260
|
-
}) => Promise<{
|
|
261
|
-
status: string;
|
|
262
|
-
blockNumber: bigint;
|
|
263
|
-
}>;
|
|
264
|
-
};
|
|
251
|
+
type EthereumPublicClient = Pick<ReturnType<typeof createPublicClient>, 'getBalance' | 'getBlock' | 'getBlockNumber' | 'readContract' | 'estimateGas'>;
|
|
265
252
|
type EthereumWalletClient = {
|
|
266
253
|
sendTransaction: (...args: any[]) => Promise<Hex>;
|
|
267
254
|
writeContract: (...args: any[]) => Promise<Hex>;
|
|
@@ -302,9 +289,9 @@ declare class EthereumProofE2eHarness {
|
|
|
302
289
|
submit(tx: SubmittableExtrinsic, signer: KeyringPair): Promise<TestTxResult>;
|
|
303
290
|
sudoSubmit(tx: SubmittableExtrinsic): Promise<TestTxResult>;
|
|
304
291
|
syncVerifierThrough(minimumExecutionBlockNumber: bigint): Promise<void>;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
292
|
+
proveGatewayActivities(gatewayAddress: Hex, throughExecutionBlockNumber: bigint): Promise<{
|
|
293
|
+
payloads: _argonprotocol_mainchain.EthereumGatewayActivityStorageProofPayload[];
|
|
294
|
+
results: TestTxResult[];
|
|
308
295
|
}>;
|
|
309
296
|
configureEthereumRuntime(gateway: TestMintingGateway, mode: RuntimeSetupMode): Promise<{
|
|
310
297
|
result: TestTxResult;
|
|
@@ -331,16 +318,10 @@ declare class TestMintingGateway {
|
|
|
331
318
|
forceUpdateActiveCouncil(replacementCouncil: {
|
|
332
319
|
signers: Hex[];
|
|
333
320
|
weights: bigint[];
|
|
334
|
-
}, nextMicrogonsPerArgonot: bigint): Promise<
|
|
335
|
-
|
|
336
|
-
blockNumber: bigint;
|
|
337
|
-
}>;
|
|
338
|
-
relayReadyApprovals(batch: Awaited<ReturnType<typeof getReadyEthereumGatewayUpdates>>, operatorAddress: string): Promise<{
|
|
339
|
-
status: string;
|
|
340
|
-
blockNumber: bigint;
|
|
341
|
-
}>;
|
|
321
|
+
}, nextMicrogonsPerArgonot: bigint): Promise<viem.TransactionReceipt>;
|
|
322
|
+
relayReadyApprovals(batch: Awaited<ReturnType<typeof getReadyEthereumGatewayUpdates>>, operatorAddress: string): Promise<viem.TransactionReceipt>;
|
|
342
323
|
argonApprovalsNonce(): Promise<bigint>;
|
|
343
|
-
globalIssuanceCouncil(): Promise<[
|
|
324
|
+
globalIssuanceCouncil(): Promise<readonly [bigint, bigint, `0x${string}`, bigint]>;
|
|
344
325
|
authorityCollateral(signingKey: Hex): Promise<[bigint, bigint]>;
|
|
345
326
|
finalizeTransferOut(args: {
|
|
346
327
|
transferRequest: {
|
|
@@ -356,16 +337,10 @@ declare class TestMintingGateway {
|
|
|
356
337
|
};
|
|
357
338
|
collateralizationSignature: Hex;
|
|
358
339
|
micronotCollateral: bigint;
|
|
359
|
-
}): Promise<
|
|
360
|
-
status: string;
|
|
361
|
-
blockNumber: bigint;
|
|
362
|
-
}>;
|
|
340
|
+
}): Promise<viem.TransactionReceipt>;
|
|
363
341
|
isFinalizedTransferOut(transferRequest: Parameters<typeof EvmContracts.hashMintingGatewayTransferOutOfArgonRequest>[0]): Promise<boolean>;
|
|
364
342
|
argonBalance(address: Hex): Promise<bigint>;
|
|
365
|
-
fundExecutionAccount(address: Hex, value: bigint): Promise<
|
|
366
|
-
status: string;
|
|
367
|
-
blockNumber: bigint;
|
|
368
|
-
}>;
|
|
343
|
+
fundExecutionAccount(address: Hex, value: bigint): Promise<viem.TransactionReceipt>;
|
|
369
344
|
}
|
|
370
345
|
declare class TestMintingAuthorityActor {
|
|
371
346
|
readonly harness: EthereumProofE2eHarness;
|
package/lib/index.js
CHANGED
|
@@ -1173,7 +1173,7 @@ import {
|
|
|
1173
1173
|
isOutdatedTransactionError,
|
|
1174
1174
|
u8aToHex
|
|
1175
1175
|
} from "@argonprotocol/mainchain";
|
|
1176
|
-
import { parseSignature } from "viem";
|
|
1176
|
+
import { formatTransactionReceipt, parseSignature } from "viem";
|
|
1177
1177
|
async function signGatewayPermit(args) {
|
|
1178
1178
|
const signature = parseSignature(
|
|
1179
1179
|
await args.account.signTypedData({
|
|
@@ -1268,7 +1268,7 @@ async function waitForExecutionReceipt2(ethereum, transactionHash) {
|
|
|
1268
1268
|
[transactionHash]
|
|
1269
1269
|
);
|
|
1270
1270
|
if (receipt) {
|
|
1271
|
-
return receipt;
|
|
1271
|
+
return formatTransactionReceipt(receipt);
|
|
1272
1272
|
}
|
|
1273
1273
|
} catch (error) {
|
|
1274
1274
|
const errorText = error instanceof Error ? [
|
|
@@ -1642,11 +1642,14 @@ function toHexValue(value) {
|
|
|
1642
1642
|
|
|
1643
1643
|
// src/TestEthereumProofActors.ts
|
|
1644
1644
|
import {
|
|
1645
|
-
|
|
1645
|
+
buildGatewayActivityStorageProofs,
|
|
1646
|
+
captureGatewayActivityStorageProofs,
|
|
1647
|
+
discoverMissingGatewayActivityLocators,
|
|
1646
1648
|
decodeAddress,
|
|
1647
1649
|
dispatchErrorToString,
|
|
1648
1650
|
EvmContracts as EvmContracts3,
|
|
1649
1651
|
FIXED_U128_DECIMALS,
|
|
1652
|
+
getLatestArgonFinalizedExecutionHeader as getLatestArgonFinalizedExecutionHeader2,
|
|
1650
1653
|
getEthereumBeaconSyncBootstrapTx,
|
|
1651
1654
|
hexToU8a as hexToU8a2,
|
|
1652
1655
|
Keyring as Keyring3,
|
|
@@ -1688,7 +1691,6 @@ var EthereumProofE2eHarness = class _EthereumProofE2eHarness {
|
|
|
1688
1691
|
}
|
|
1689
1692
|
});
|
|
1690
1693
|
this.publicClient = createPublicClient2({
|
|
1691
|
-
chain: this.chain,
|
|
1692
1694
|
transport: http3(endpoints.executionRpcUrl)
|
|
1693
1695
|
});
|
|
1694
1696
|
this.walletClient = createWalletClient3({
|
|
@@ -1754,24 +1756,54 @@ var EthereumProofE2eHarness = class _EthereumProofE2eHarness {
|
|
|
1754
1756
|
minimumExecutionBlockNumber
|
|
1755
1757
|
);
|
|
1756
1758
|
}
|
|
1757
|
-
async
|
|
1758
|
-
const
|
|
1759
|
+
async proveGatewayActivities(gatewayAddress, throughExecutionBlockNumber) {
|
|
1760
|
+
const argonFinalizedExecutionHeader = await getLatestArgonFinalizedExecutionHeader2(
|
|
1761
|
+
this.mainchainClient
|
|
1762
|
+
);
|
|
1763
|
+
const currentGatewayState = await this.mainchainClient.query.crosschainTransfer.gatewayStateBySourceChain("Ethereum");
|
|
1764
|
+
const minimumGatewayActivityNonce = currentGatewayState.isSome ? currentGatewayState.unwrap().gatewayActivityNonce.toBigInt() + 1n : 1n;
|
|
1765
|
+
const collectedLocators = await discoverMissingGatewayActivityLocators({
|
|
1766
|
+
finalizedExecutionBlockNumber: argonFinalizedExecutionHeader.blockNumber,
|
|
1759
1767
|
executionRpcUrl: this.endpoints.executionRpcUrl,
|
|
1760
1768
|
gatewayAddress,
|
|
1761
|
-
|
|
1769
|
+
minimumGatewayActivityNonce
|
|
1762
1770
|
});
|
|
1763
|
-
|
|
1771
|
+
const locators = collectedLocators.filter(
|
|
1772
|
+
(locator) => locator.blockNumber <= throughExecutionBlockNumber
|
|
1773
|
+
);
|
|
1774
|
+
if (locators.length === 0) {
|
|
1764
1775
|
throw new Error("Expected uncovered gateway activity to prove");
|
|
1765
1776
|
}
|
|
1766
|
-
const
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1777
|
+
const executionBlock = await this.publicClient.getBlock({
|
|
1778
|
+
blockNumber: argonFinalizedExecutionHeader.blockNumber
|
|
1779
|
+
});
|
|
1780
|
+
const captures = await captureGatewayActivityStorageProofs({
|
|
1781
|
+
executionRpcUrl: this.endpoints.executionRpcUrl,
|
|
1782
|
+
executionBlock,
|
|
1783
|
+
gatewayAddress,
|
|
1784
|
+
locators
|
|
1785
|
+
});
|
|
1786
|
+
const { payloads } = await buildGatewayActivityStorageProofs(this.mainchainClient, {
|
|
1787
|
+
executionRpcUrl: this.endpoints.executionRpcUrl,
|
|
1788
|
+
gatewayAddress,
|
|
1789
|
+
locators: captures
|
|
1790
|
+
});
|
|
1791
|
+
if (payloads.length === 0) {
|
|
1792
|
+
throw new Error("Expected uncovered gateway activity to prove");
|
|
1793
|
+
}
|
|
1794
|
+
const results = [];
|
|
1795
|
+
for (const payload of payloads) {
|
|
1796
|
+
const result = await this.submit(
|
|
1797
|
+
this.mainchainClient.tx.crosschainTransfer.proveGatewayActivityStorage(
|
|
1798
|
+
"Ethereum",
|
|
1799
|
+
payload.previousGatewayActivityNonce,
|
|
1800
|
+
payload.proof
|
|
1801
|
+
),
|
|
1802
|
+
this.proofRelayer
|
|
1803
|
+
);
|
|
1804
|
+
results.push(result);
|
|
1805
|
+
}
|
|
1806
|
+
return { payloads, results };
|
|
1775
1807
|
}
|
|
1776
1808
|
async configureEthereumRuntime(gateway, mode) {
|
|
1777
1809
|
const calls = [
|
|
@@ -1888,6 +1920,24 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1888
1920
|
nonce: permitNonce,
|
|
1889
1921
|
deadline: permitDeadline
|
|
1890
1922
|
});
|
|
1923
|
+
const data = encodeFunctionData2({
|
|
1924
|
+
abi: mintingGatewayAbi2,
|
|
1925
|
+
functionName: "startTransferToArgon",
|
|
1926
|
+
args: [
|
|
1927
|
+
this.argonTokenAddress,
|
|
1928
|
+
args.amountRuntimeUnits,
|
|
1929
|
+
args.recipientArgonAddress,
|
|
1930
|
+
permitDeadline,
|
|
1931
|
+
permitSignature.v,
|
|
1932
|
+
permitSignature.r,
|
|
1933
|
+
permitSignature.s
|
|
1934
|
+
]
|
|
1935
|
+
});
|
|
1936
|
+
const estimatedGas = await this.harness.publicClient.estimateGas({
|
|
1937
|
+
account: args.account,
|
|
1938
|
+
to: this.gatewayAddress,
|
|
1939
|
+
data
|
|
1940
|
+
});
|
|
1891
1941
|
const transactionHash = await createWalletClient3({
|
|
1892
1942
|
account: args.account,
|
|
1893
1943
|
chain: this.harness.chain,
|
|
@@ -1896,25 +1946,20 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1896
1946
|
account: args.account,
|
|
1897
1947
|
chain: this.harness.chain,
|
|
1898
1948
|
to: this.gatewayAddress,
|
|
1899
|
-
data
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
args: [
|
|
1903
|
-
this.argonTokenAddress,
|
|
1904
|
-
args.amountRuntimeUnits,
|
|
1905
|
-
args.recipientArgonAddress,
|
|
1906
|
-
permitDeadline,
|
|
1907
|
-
permitSignature.v,
|
|
1908
|
-
permitSignature.r,
|
|
1909
|
-
permitSignature.s
|
|
1910
|
-
]
|
|
1911
|
-
})
|
|
1949
|
+
data,
|
|
1950
|
+
// Estimation may append to this block's locator; mining in a new block creates storage slots.
|
|
1951
|
+
gas: estimatedGas * 2n
|
|
1912
1952
|
});
|
|
1913
|
-
|
|
1953
|
+
const receipt = await waitForExecutionReceipt2(this.harness.ethereum, transactionHash);
|
|
1954
|
+
if (receipt.status !== "success") {
|
|
1955
|
+
throw new Error(`Transfer to Argon reverted: ${transactionHash}`);
|
|
1956
|
+
}
|
|
1957
|
+
return receipt;
|
|
1914
1958
|
}
|
|
1915
1959
|
async forceUpdateActiveCouncil(replacementCouncil, nextMicrogonsPerArgonot) {
|
|
1916
|
-
return
|
|
1917
|
-
|
|
1960
|
+
return waitForExecutionReceipt2(
|
|
1961
|
+
this.harness.ethereum,
|
|
1962
|
+
await this.harness.walletClient.writeContract({
|
|
1918
1963
|
account: this.harness.deployer,
|
|
1919
1964
|
chain: this.harness.chain,
|
|
1920
1965
|
address: this.gatewayAddress,
|
|
@@ -1922,11 +1967,12 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1922
1967
|
functionName: "forceUpdateActiveCouncil",
|
|
1923
1968
|
args: [replacementCouncil, nextMicrogonsPerArgonot]
|
|
1924
1969
|
})
|
|
1925
|
-
|
|
1970
|
+
);
|
|
1926
1971
|
}
|
|
1927
1972
|
async relayReadyApprovals(batch, operatorAddress) {
|
|
1928
|
-
return
|
|
1929
|
-
|
|
1973
|
+
return waitForExecutionReceipt2(
|
|
1974
|
+
this.harness.ethereum,
|
|
1975
|
+
await this.harness.walletClient.writeContract({
|
|
1930
1976
|
account: this.harness.deployer,
|
|
1931
1977
|
chain: this.harness.chain,
|
|
1932
1978
|
address: this.gatewayAddress,
|
|
@@ -1938,17 +1984,17 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1938
1984
|
toHex(decodeAddress(operatorAddress), { size: 32 })
|
|
1939
1985
|
]
|
|
1940
1986
|
})
|
|
1941
|
-
|
|
1987
|
+
);
|
|
1942
1988
|
}
|
|
1943
1989
|
async argonApprovalsNonce() {
|
|
1944
|
-
return
|
|
1990
|
+
return this.harness.publicClient.readContract({
|
|
1945
1991
|
address: this.gatewayAddress,
|
|
1946
1992
|
abi: mintingGatewayAbi2,
|
|
1947
1993
|
functionName: "argonApprovalsNonce"
|
|
1948
1994
|
});
|
|
1949
1995
|
}
|
|
1950
1996
|
async globalIssuanceCouncil() {
|
|
1951
|
-
return
|
|
1997
|
+
return this.harness.publicClient.readContract({
|
|
1952
1998
|
address: this.gatewayAddress,
|
|
1953
1999
|
abi: mintingGatewayAbi2,
|
|
1954
2000
|
functionName: "globalIssuanceCouncil"
|
|
@@ -1963,8 +2009,9 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1963
2009
|
});
|
|
1964
2010
|
}
|
|
1965
2011
|
async finalizeTransferOut(args) {
|
|
1966
|
-
return
|
|
1967
|
-
|
|
2012
|
+
return waitForExecutionReceipt2(
|
|
2013
|
+
this.harness.ethereum,
|
|
2014
|
+
await this.harness.walletClient.writeContract({
|
|
1968
2015
|
account: this.harness.deployer,
|
|
1969
2016
|
chain: this.harness.chain,
|
|
1970
2017
|
address: this.gatewayAddress,
|
|
@@ -1983,10 +2030,10 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1983
2030
|
}
|
|
1984
2031
|
]
|
|
1985
2032
|
})
|
|
1986
|
-
|
|
2033
|
+
);
|
|
1987
2034
|
}
|
|
1988
2035
|
async isFinalizedTransferOut(transferRequest) {
|
|
1989
|
-
return
|
|
2036
|
+
return this.harness.publicClient.readContract({
|
|
1990
2037
|
address: this.gatewayAddress,
|
|
1991
2038
|
abi: mintingGatewayAbi2,
|
|
1992
2039
|
functionName: "finalizedTransferOutOfArgonIds",
|
|
@@ -1994,7 +2041,7 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
1994
2041
|
});
|
|
1995
2042
|
}
|
|
1996
2043
|
async argonBalance(address) {
|
|
1997
|
-
return
|
|
2044
|
+
return this.harness.publicClient.readContract({
|
|
1998
2045
|
address: this.argonTokenAddress,
|
|
1999
2046
|
abi: argonTokenAbi,
|
|
2000
2047
|
functionName: "balanceOf",
|
|
@@ -2002,14 +2049,15 @@ var TestMintingGateway = class _TestMintingGateway {
|
|
|
2002
2049
|
});
|
|
2003
2050
|
}
|
|
2004
2051
|
async fundExecutionAccount(address, value) {
|
|
2005
|
-
return
|
|
2006
|
-
|
|
2052
|
+
return waitForExecutionReceipt2(
|
|
2053
|
+
this.harness.ethereum,
|
|
2054
|
+
await this.harness.walletClient.sendTransaction({
|
|
2007
2055
|
account: this.harness.deployer,
|
|
2008
2056
|
chain: this.harness.chain,
|
|
2009
2057
|
to: address,
|
|
2010
2058
|
value
|
|
2011
2059
|
})
|
|
2012
|
-
|
|
2060
|
+
);
|
|
2013
2061
|
}
|
|
2014
2062
|
};
|
|
2015
2063
|
var TestMintingAuthorityActor = class {
|