difftreelog
style fix formatting
in: master
2 files changed
crates/evm-coder-macros/src/lib.rsdiffbeforeafterboth186186187/// Derives call enum implementing [`evm_coder::Callable`], [`evm_coder::Weighted`]187/// Derives call enum implementing [`evm_coder::Callable`], [`evm_coder::Weighted`]188/// and [`evm_coder::Call`] from impl block188/// and [`evm_coder::Call`] from impl block189/// 189///190/// ## Macro syntax190/// ## Macro syntax191/// 191///192/// `#[solidity_interface(name, is, inline_is, events)]`192/// `#[solidity_interface(name, is, inline_is, events)]`193/// - *name*: used in generated code, and for Call enum name193/// - *name*: used in generated code, and for Call enum name194/// - *is*: used to provide call inheritance, not found methods will be delegated to all contracts194/// - *is*: used to provide call inheritance, not found methods will be delegated to all contracts195/// specified in is/inline_is 195/// specified in is/inline_is196/// - *inline_is*: same as is, but selectors for passed contracts will be used by derived ERC165196/// - *inline_is*: same as is, but selectors for passed contracts will be used by derived ERC165197/// implementation197/// implementation198/// 198///199/// `#[weight(value)]`199/// `#[weight(value)]`200/// Can be added to every method of impl block, used for deriving [`evm_coder::Weighted`], which200/// Can be added to every method of impl block, used for deriving [`evm_coder::Weighted`], which201/// is used by substrate bridge201/// is used by substrate bridge202/// - *value*: expression, which evaluates to weight required to call this method.202/// - *value*: expression, which evaluates to weight required to call this method.203/// This expression can use call arguments to calculate non-constant execution time.203/// This expression can use call arguments to calculate non-constant execution time.204/// This expression should evaluate faster than actual execution does, and may provide worser case204/// This expression should evaluate faster than actual execution does, and may provide worser case205/// than one is called205/// than one is called206/// 206///207/// `#[solidity_interface(rename_selector)]`207/// `#[solidity_interface(rename_selector)]`208/// - *rename_selector*: by default, selector name will be generated by transforming method name208/// - *rename_selector*: by default, selector name will be generated by transforming method name209/// from snake_case to camelCase. Use this option, if other naming convention is required.209/// from snake_case to camelCase. Use this option, if other naming convention is required.210/// I.e: method `token_uri` will be automatically renamed to `tokenUri` in selector, but name210/// I.e: method `token_uri` will be automatically renamed to `tokenUri` in selector, but name211/// required by ERC721 standard is `tokenURI`, thus we need to specify `rename_selector = "tokenURI"`211/// required by ERC721 standard is `tokenURI`, thus we need to specify `rename_selector = "tokenURI"`212/// explicitly212/// explicitly213/// 213///214/// Also, any contract method may have doc comments, which will be automatically added to generated214/// Also, any contract method may have doc comments, which will be automatically added to generated215/// solidity interface definitions215/// solidity interface definitions216/// 216///217/// ## Example217/// ## Example218/// 218///219/// ```ignore219/// ```ignore220/// struct SuperContract;220/// struct SuperContract;221/// struct InlineContract;221/// struct InlineContract;222/// struct Contract;222/// struct Contract;223/// 223///224/// #[derive(ToLog)]224/// #[derive(ToLog)]225/// enum ContractEvents {225/// enum ContractEvents {226/// Event(#[indexed] uint32), 226/// Event(#[indexed] uint32),227/// }227/// }228/// 228///229/// #[solidity_interface(name = "MyContract", is(SuperContract), inline_is(InlineContract))]229/// #[solidity_interface(name = "MyContract", is(SuperContract), inline_is(InlineContract))]230/// impl Contract {230/// impl Contract {231/// /// Multiply two numbers231/// /// Multiply two numbers232/// #[weight(200 + a + b)]232/// #[weight(200 + a + b)]233/// #[solidity_interface(rename_selector = "mul")]233/// #[solidity_interface(rename_selector = "mul")]234/// fn mul(&mut self, a: uint32, b: uint32) -> Result<uint32> {234/// fn mul(&mut self, a: uint32, b: uint32) -> Result<uint32> {235/// Ok(a.checked_mul(b).ok_or("overflow")?) 235/// Ok(a.checked_mul(b).ok_or("overflow")?)236/// }236/// }237/// }237/// }238/// ```238/// ```269}269}270270271/// ## Syntax271/// ## Syntax272/// 272///273/// `#[indexed]`273/// `#[indexed]`274/// Marks this field as indexed, so it will appear in [`ethereum::Log`] topics instead of data274/// Marks this field as indexed, so it will appear in [`ethereum::Log`] topics instead of data275#[proc_macro_derive(ToLog, attributes(indexed))]275#[proc_macro_derive(ToLog, attributes(indexed))]pallets/unique/src/mock.rsdiffbeforeafterbothno syntactic changes