MCPcopy Create free account
hub / github.com/circlefin/arc-node / verifySuccess

Function verifySuccess

tests/localdev/NativeFiatToken.test.ts:1699–1724  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1697 .then(ReceiptVerifier.waitSuccess)
1698
1699 const verifySuccess = async () => {
1700 if (tc.fn === 'mint') {
1701 receipt.verifyEvents((ev) => {
1702 ev.expectNativeMint({ recipient: receiver, amount: USDC.toNative(amount) })
1703 .expectUSDCMint({ minter: helper, to: receiver, amount: amount })
1704 .expectUSDCTransfer({ from: zeroAddress, to: receiver, value: amount })
1705 .expectExecutionResult({ helper, success: true, result: toBytes32(1n) })
1706 .expectAllEventsMatched()
1707 })
1708 await balances
1709 .decrease({ sender: receipt.totalFee() })
1710 .increase({ receiverUSDC: amount, totalSupply: USDC.toNative(amount) })
1711 .verify()
1712 } else {
1713 receipt.verifyEvents((ev) => {
1714 ev.expectNativeTransfer({ from: helper, to: receiver, amount: USDC.toNative(amount) })
1715 .expectUSDCTransfer({ from: helper, to: receiver, value: amount })
1716 .expectExecutionResult({ helper, success: true, result: toBytes32(1n) })
1717 .expectAllEventsMatched()
1718 })
1719 await balances
1720 .decrease({ sender: receipt.totalFee(), helper: USDC.toNative(amount) })
1721 .increase({ receiverUSDC: amount })
1722 .verify()
1723 }
1724 }
1725
1726 return { receipt, balances, helper, amount, sender, receiver, verifySuccess }
1727 }

Callers 1

Calls 3

toBytes32Function · 0.90
toNativeMethod · 0.80
verifyMethod · 0.80

Tested by

no test coverage detected