1use evm_coder::{types::*, solidity_interface, execution::Result};2use evm_coder::{3 make_signature,4 custom_signature::{5 SIGNATURE_SIZE_LIMIT, SignatureUnit, SignaturePreferences, FunctionSignature,6 },7 types::Signature,8};910pub struct Contract(bool);1112#[solidity_interface(name = A)]13impl Contract {14 fn method_a() -> Result<void> {15 Ok(())16 }17}1819#[solidity_interface(name = B)]20impl Contract {21 fn method_b() -> Result<void> {22 Ok(())23 }24}2526#[solidity_interface(name = Contract, is(27 A(if(this.0)),28 B(if(!this.0)),29))]30impl Contract {}3132#[test]33fn conditional_erc165() {34 assert!(ContractCall::supports_interface(35 &Contract(true),36 ACall::METHOD_A37 ));38 assert!(!ContractCall::supports_interface(39 &Contract(false),40 ACall::METHOD_A41 ));4243 assert!(ContractCall::supports_interface(44 &Contract(false),45 BCall::METHOD_B46 ));47 assert!(!ContractCall::supports_interface(48 &Contract(true),49 BCall::METHOD_B50 ));51}