-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVM-IT: Check in generated ABI code.
- Loading branch information
Showing
9 changed files
with
349 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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
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 |
---|---|---|
@@ -1,25 +1 @@ | ||
pub mod simplecoin; | ||
|
||
/// Create a `new` method in a module with a smart contract. | ||
/// | ||
/// # Example | ||
/// | ||
/// ```ignore | ||
/// abigen!(SimpleCoin, "./artifacts/SimpleCoin.sol/SimpleCoin.abi"); | ||
/// | ||
/// new_with_mock_provider!(SimpleCoin); | ||
/// ``` | ||
#[macro_export] | ||
macro_rules! new_with_mock_provider { | ||
($contract:ident) => { | ||
pub fn new( | ||
owner: fil_actor_evm::interpreter::address::EthAddress, | ||
) -> $contract<ethers::providers::Provider<ethers::providers::MockProvider>> { | ||
// The owner of the contract is expected to be the 160 bit hash used on Ethereum. | ||
let address = ethers::core::types::Address::from_slice(owner.as_ref()); | ||
// A dummy client that we don't intend to use to call the contract or send transactions. | ||
let (client, _mock) = ethers::providers::Provider::mocked(); | ||
$contract::new(address, std::sync::Arc::new(client)) | ||
} | ||
}; | ||
} | ||
pub mod simple_coin; |
Oops, something went wrong.