Class: Paleth::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/paleth/transaction.rb

Overview

Repesents a transaction on an ethereum blockchain

Constant Summary collapse

SIMPLE_METHODS =
i(hash nonce block_hash block_number transaction_index
from to gas input)
BIGDECIMAL_METHODS =
i(gas_price gas)

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Transaction


4
5
6
# File 'lib/paleth/transaction.rb', line 4

def initialize(data)
  @data = data
end

Instance Method Details

#to_sObject


25
26
27
28
29
30
31
32
# File 'lib/paleth/transaction.rb', line 25

def to_s
  data = [SIMPLE_METHODS + BIGDECIMAL_METHODS].flatten.map do |name|
    value = self.send(name)
    "#{name}=#{value}"
  end.join(', ')

  "Transaction(#{data})"
end