test(abigen): add etherscan test case (#964)
This commit is contained in:
parent
601cb1b75e
commit
72da5913d2
|
@ -5,7 +5,7 @@ use ethers_core::{
|
||||||
abi::{AbiDecode, AbiEncode, Address, Tokenizable},
|
abi::{AbiDecode, AbiEncode, Address, Tokenizable},
|
||||||
types::{transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, U256},
|
types::{transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, U256},
|
||||||
};
|
};
|
||||||
use ethers_providers::Provider;
|
use ethers_providers::{MockProvider, Provider};
|
||||||
use ethers_solc::Solc;
|
use ethers_solc::Solc;
|
||||||
use std::{convert::TryFrom, sync::Arc};
|
use std::{convert::TryFrom, sync::Arc};
|
||||||
|
|
||||||
|
@ -472,3 +472,15 @@ async fn can_abiencoderv2_output() {
|
||||||
let res = contract.default_person().call().await.unwrap();
|
let res = contract.default_person().call().await.unwrap();
|
||||||
assert_eq!(res, person);
|
assert_eq!(res, person);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn can_gen_multi_etherscan() {
|
||||||
|
abigen!(
|
||||||
|
MyContract, "etherscan:0xdAC17F958D2ee523a2206206994597C13D831ec7";
|
||||||
|
MyContract2, "etherscan:0x8418bb725b3ac45ec8fff3791dd8b4e0480cc2a2";
|
||||||
|
);
|
||||||
|
|
||||||
|
let provider = Arc::new(Provider::new(MockProvider::new()));
|
||||||
|
let _contract = MyContract::new(Address::default(), Arc::clone(&provider));
|
||||||
|
let _contract = MyContract2::new(Address::default(), provider);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue