git.delta.rocks / unique-network / refs/commits / cde495e75856

difftreelog

source

crates/evm-coder/tests/random.rs2.0 KiBsourcehistory
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![allow(dead_code)] // This test only checks that macros is not panicking1819use evm_coder::{20	abi::AbiType, ToLog, execution::Result, solidity_interface, types::*, solidity, weight,21};22use primitive_types::U256;2324pub struct Impls;2526#[solidity_interface(name = OurInterface)]27impl Impls {28	fn fn_a(&self, _input: U256) -> Result<bool> {29		unreachable!()30	}31}3233#[solidity_interface(name = OurInterface1)]34impl Impls {35	fn fn_b(&self, _input: u128) -> Result<u32> {36		unreachable!()37	}38}3940#[derive(ToLog)]41enum OurEvents {42	Event1 {43		field1: u32,44	},45	Event2 {46		field1: u32,47		#[indexed]48		field2: u32,49	},50}5152#[solidity_interface(53	name = OurInterface2,54	is(OurInterface),55	inline_is(OurInterface1),56	events(OurEvents)57)]58impl Impls {59	#[solidity(rename_selector = "fnK")]60	fn fn_c(&self, _input: u32) -> Result<u8> {61		unreachable!()62	}63	fn fn_d(&self, _value: u32) -> Result<u32> {64		unreachable!()65	}6667	fn caller_sensitive(&self, _caller: Caller) -> Result<u8> {68		unreachable!()69	}70	fn payable(&mut self, _value: Value) -> Result<u8> {71		unreachable!()72	}7374	#[weight(*_weight)]75	fn with_weight(&self, _weight: u64) -> Result<()> {76		unreachable!()77	}7879	/// Doccoment example80	fn with_doc(&self) -> Result<()> {81		unreachable!()82	}83}8485#[solidity_interface(86	name = ValidSelector,87	expect_selector = 0x00000000,88)]89impl Impls {}