Class: Web3::Eth::ParityModule

Inherits:
Object
  • Object
show all
Includes:
Utility
Defined in:
lib/web3/eth/parity_module.rb

Constant Summary collapse

PREFIX =
'parity_'

Instance Method Summary collapse

Methods included from Utility

#from_hex, #hex, #remove_0x_head, #wei_to_ether

Constructor Details

#initialize(web3_rpc) ⇒ ParityModule

Returns a new instance of ParityModule.



10
11
12
# File 'lib/web3/eth/parity_module.rb', line 10

def initialize web3_rpc
  @web3_rpc = web3_rpc
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



14
15
16
# File 'lib/web3/eth/parity_module.rb', line 14

def method_missing m, *args
  @web3_rpc.request "#{PREFIX}#{m}", args[0]
end

Instance Method Details

#getBlockReceiptsByBlockNumber(block) ⇒ Object



18
19
20
21
22
# File 'lib/web3/eth/parity_module.rb', line 18

def getBlockReceiptsByBlockNumber block
  @web3_rpc.request("#{PREFIX}getBlockReceipts", [hex(block)]).collect{|tr|
    TransactionReceipt.new tr
  }
end