Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross-VM transfer NFT/FT to and from EVM #90

Merged
merged 8 commits into from
Jun 27, 2024
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ coverage.lcov
local.flow.json

# Local
.DS_Store
.DS_Store
.vscode/
43 changes: 30 additions & 13 deletions cadence/tests/flow_evm_bridge_handler_tests.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,11 @@ fun testBridgeHandledCadenceNativeTokenToEVMFails() {
// Execute bridge to EVM - should fail since Handler is not enabled
bridgeTokensToEVM(
signer: alice,
contractAddr: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
vaultIdentifier: buildTypeIdentifier(
address: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
resourceName: "Vault"
),
amount: cadenceBalance,
beFailed: true
)
Expand All @@ -474,8 +477,11 @@ fun testBridgeHandledCadenceNativeTokenFromEVMFails() {
// Execute bridge from EVM
bridgeTokensFromEVM(
signer: alice,
contractAddr: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
vaultIdentifier: buildTypeIdentifier(
address: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
resourceName: "Vault"
),
amount: evmBalance,
beFailed: true
)
Expand Down Expand Up @@ -518,8 +524,11 @@ fun testBridgeHandledCadenceNativeTokenToEVMFirstSucceeds() {
// Execute bridge to EVM
bridgeTokensToEVM(
signer: alice,
contractAddr: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
vaultIdentifier: buildTypeIdentifier(
address: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
resourceName: "Vault"
),
amount: cadenceBalance,
beFailed: false
)
Expand Down Expand Up @@ -557,8 +566,11 @@ fun testBridgeHandledCadenceNativeTokenFromEVMSecondSucceeds() {
let ufixEVMbalance = uint256ToUFix64(evmBalance, decimals: defaultDecimals)
bridgeTokensFromEVM(
signer: alice,
contractAddr: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
vaultIdentifier: buildTypeIdentifier(
address: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
resourceName: "Vault"
),
amount: evmBalance,
beFailed: false
)
Expand Down Expand Up @@ -617,8 +629,11 @@ fun testBridgeHandledCadenceNativeTokenFromEVMFirstSucceeds() {
// Execute bridge from EVM
bridgeTokensFromEVM(
signer: alice,
contractAddr: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
vaultIdentifier: buildTypeIdentifier(
address: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
resourceName: "Vault"
),
amount: aliceEVMBalanceBefore,
beFailed: false
)
Expand Down Expand Up @@ -666,9 +681,11 @@ fun testBridgeHandledCadenceNativeTokenToEVMSecondSucceeds() {
// Execute bridge to EVM
bridgeTokensToEVM(
signer: alice,
contractAddr: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
amount: aliceCadenceBalanceBefore,
vaultIdentifier: buildTypeIdentifier(
address: exampleHandledTokenAccount.address,
contractName: "ExampleHandledToken",
resourceName: "Vault"
), amount: aliceCadenceBalanceBefore,
beFailed: false
)

Expand Down
Loading
Loading