-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test cases for e2e cadence- & evm-native NFT bridging
- Loading branch information
1 parent
113b301
commit ad8ca3e
Showing
3 changed files
with
242 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import "NonFungibleToken" | ||
|
||
import "CrossVMNFT" | ||
|
||
access(all) | ||
fun main(ownerAddr: Address, cadenceID: UInt64, collectionStoragePath: StoragePath): UInt256? { | ||
if let collection = getAuthAccount<auth(BorrowValue) &Account>(ownerAddr).storage.borrow<&{NonFungibleToken.Collection}>( | ||
from: collectionStoragePath | ||
) { | ||
if let nft = collection.borrowNFT(cadenceID) { | ||
return CrossVMNFT.getEVMID(from: nft) | ||
} | ||
} | ||
return nil | ||
} |
10 changes: 10 additions & 0 deletions
10
cadence/scripts/utils/derive_bridged_nft_contract_name.cdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "EVM" | ||
|
||
import "FlowEVMBridgeUtils" | ||
|
||
access(all) | ||
fun main(evmAddressHex: String): String { | ||
return FlowEVMBridgeUtils.deriveBridgedNFTContractName( | ||
from: FlowEVMBridgeUtils.getEVMAddressFromHexString(address: evmAddressHex) ?? panic("Could not parse EVM address from hex string") | ||
) | ||
} |
Oops, something went wrong.