-
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 coverage - found issue with test setup
- Loading branch information
1 parent
da96b31
commit db6f166
Showing
5 changed files
with
105 additions
and
10 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,22 @@ | ||
import "EVM" | ||
|
||
import "FlowEVMBridgeUtils" | ||
|
||
/// Returns whether the given owner (hex-encoded EVM address - minus 0x prefix) is the owner of the given ERC721 NFT | ||
/// defined at the hex-encoded EVM contract address | ||
/// | ||
/// @param ofNFT: The ERC721 ID of the NFT | ||
/// @param owner: The hex-encoded EVM address of the owner without the 0x prefix | ||
/// @param evmContractAddress: The hex-encoded EVM contract address of the ERC721 contract without the 0x prefix | ||
/// | ||
/// @return Whether the given owner is the owner of the given ERC721 NFT. Reverts on call failure. | ||
/// | ||
access(all) fun main(ofNFT: UInt256, owner: String, evmContractAddress: String): Bool { | ||
return FlowEVMBridgeUtils.isOwner( | ||
ofNFT: ofNFT, | ||
owner: FlowEVMBridgeUtils.getEVMAddressFromHexString(address: owner) | ||
?? panic("Invalid owner address"), | ||
evmContractAddress: FlowEVMBridgeUtils.getEVMAddressFromHexString(address: evmContractAddress) | ||
?? panic("Invalid EVM contract address") | ||
) | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,5 @@ | ||
transaction(name: String, codeHex: String, arg0: AnyStruct, arg1: AnyStruct) { | ||
prepare(signer: auth(AddContract) &Account) { | ||
signer.contracts.add(name: name, code: codeHex.decodeHex(), arg0, arg1) | ||
} | ||
} |
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