test(abigen): add etherscan test case (#964)

This commit is contained in:
Matthias Seitz 2022-02-24 21:07:58 +01:00 committed by GitHub
parent 601cb1b75e
commit 72da5913d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,7 @@ use ethers_core::{
abi::{AbiDecode, AbiEncode, Address, Tokenizable},
types::{transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, U256},
};
use ethers_providers::Provider;
use ethers_providers::{MockProvider, Provider};
use ethers_solc::Solc;
use std::{convert::TryFrom, sync::Arc};
@ -472,3 +472,15 @@ async fn can_abiencoderv2_output() {
let res = contract.default_person().call().await.unwrap();
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);
}