Class: Etherlite::Abi::LoadType

Inherits:
Object
  • Object
show all
Defined in:
lib/etherlite/commands/abi/load_type.rb

Constant Summary collapse

MATCHER =
/^(?:(?:(?<ty>uint|int|bytes)(?<b1>\d+)|(?<ty>uint|int|bytes)(?<b1>\d+)|(?<ty>fixed|ufixed)(?<b1>\d+)x(?<b2>\d+)|(?<ty>address|bool|uint|int|fixed|ufixed))(?:\[(?<dim>\d*)\]|)|(?<ty>bytes|string))$/

Instance Method Summary collapse

Instance Method Details

#performObject

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
# File 'lib/etherlite/commands/abi/load_type.rb', line 5

def perform
  parts = MATCHER.match @signature
  raise ArgumentError, "Invalid argument type #{@signature}" if parts.nil?

  type = build_base_type parts
  build_array_type type, parts
end