use ethers::types::Address;
use std::str::FromStr;
use crate::vault::ethereum::*;
#[test]
fn test_contract_creation() {
let abi_json = r#"[
{
"inputs": [],
"name": "getValue",
"outputs": [{"type": "uint256", "name": ""}],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{"type": "uint256", "name": "newValue"}],
"name": "setValue",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]"#;
let abi = load_abi_from_json(abi_json).unwrap();
let address = Address::from_str("0x1234567890123456789012345678901234567890").unwrap();
let network = networks::gnosis();
let contract = Contract::new(address, abi, network);
assert_eq!(contract.address, address);
assert_eq!(contract.network.name, "Gnosis");
assert!(contract.abi.function("getValue").is_ok());
assert!(contract.abi.function("setValue").is_ok());
}