git.delta.rocks / unique-network / refs/commits / 8fee3684a030

difftreelog

source

crates/evm-coder/tests/random.rs1.2 KiBsourcehistory
1#![allow(dead_code)] // This test only checks that macros is not panicking23use evm_coder::{ToLog, execution::Result, solidity_interface, types::*};4use evm_coder_macros::{solidity, weight};56struct Impls;78#[solidity_interface(name = "OurInterface")]9impl Impls {10	fn fn_a(&self, _input: uint256) -> Result<bool> {11		todo!()12	}13}1415#[solidity_interface(name = "OurInterface1")]16impl Impls {17	fn fn_b(&self, _input: uint128) -> Result<uint32> {18		todo!()19	}20}2122#[derive(ToLog)]23enum OurEvents {24	Event1 {25		field1: uint32,26	},27	Event2 {28		field1: uint32,29		#[indexed]30		field2: uint32,31	},32}3334#[solidity_interface(35	name = "OurInterface2",36	is(OurInterface),37	inline_is(OurInterface1),38	events(OurEvents)39)]40impl Impls {41	#[solidity(rename_selector = "fnK")]42	fn fn_c(&self, _input: uint32) -> Result<uint8> {43		todo!()44	}45	fn fn_d(&self, _value: uint32) -> Result<uint32> {46		todo!()47	}4849	fn caller_sensitive(&self, _caller: caller) -> Result<uint8> {50		todo!()51	}52	fn payable(&mut self, _value: value) -> Result<uint8> {53		todo!()54	}5556	#[weight(*_weight)]57	fn with_weight(&self, _weight: uint64) -> Result<void> {58		todo!()59	}6061	/// Doccoment example62	fn with_doc(&self) -> Result<void> {63		todo!()64	}65}