Class: Eth::Abi::Function::CallDescription

Inherits:
Object
  • Object
show all
Defined in:
lib/eth/abi/function.rb

Overview

A decoded function call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_interface, selector, args, kwargs) ⇒ CallDescription

Creates a description object for a decoded function call.

Parameters:

  • function_interface (Hash)

    function ABI type.

  • selector (String)

    function selector hex-string.

  • args (Array)

    decoded positional arguments.

  • kwargs (Hash)

    decoded keyword arguments.



81
82
83
84
85
86
# File 'lib/eth/abi/function.rb', line 81

def initialize(function_interface, selector, args, kwargs)
  @function_interface = function_interface
  @selector = selector
  @args = args
  @kwargs = kwargs
end

Instance Attribute Details

#argsObject

The positional arguments of the call.



67
68
69
# File 'lib/eth/abi/function.rb', line 67

def args
  @args
end

#function_interfaceObject

The function ABI interface used to decode the call.



64
65
66
# File 'lib/eth/abi/function.rb', line 64

def function_interface
  @function_interface
end

#kwargsObject

The named arguments of the call.



70
71
72
# File 'lib/eth/abi/function.rb', line 70

def kwargs
  @kwargs
end

#selectorObject

The function selector.



73
74
75
# File 'lib/eth/abi/function.rb', line 73

def selector
  @selector
end

Instance Method Details

#nameObject

The function name. (e.g. transfer)



89
90
91
# File 'lib/eth/abi/function.rb', line 89

def name
  @name ||= function_interface.fetch("name")
end

#signatureObject

The function signature. (e.g. transfer(address,uint256))



94
95
96
# File 'lib/eth/abi/function.rb', line 94

def signature
  @signature ||= Function.signature(function_interface)
end