Class: Bluzelle::Swarm::Transaction
- Inherits:
-
Object
- Object
- Bluzelle::Swarm::Transaction
- Defined in:
- lib/bluzelle/swarm/transaction.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#gas_price ⇒ Object
Returns the value of attribute gas_price.
-
#max_fee ⇒ Object
Returns the value of attribute max_fee.
-
#max_gas ⇒ Object
Returns the value of attribute max_gas.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#retries_left ⇒ Object
Returns the value of attribute retries_left.
Instance Method Summary collapse
-
#initialize(method, endpoint, data) ⇒ Transaction
constructor
A new instance of Transaction.
- #set_gas(gas_info) ⇒ Object
Constructor Details
#initialize(method, endpoint, data) ⇒ Transaction
Returns a new instance of Transaction.
9 10 11 12 13 14 15 16 17 |
# File 'lib/bluzelle/swarm/transaction.rb', line 9 def initialize(method, endpoint, data) @method = method @endpoint = endpoint @data = data @gas_price = 0 @max_gas = 0 @max_fee = 0 @retries_left = 10 end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/bluzelle/swarm/transaction.rb', line 6 def data @data end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
6 7 8 |
# File 'lib/bluzelle/swarm/transaction.rb', line 6 def endpoint @endpoint end |
#gas_price ⇒ Object
Returns the value of attribute gas_price.
7 8 9 |
# File 'lib/bluzelle/swarm/transaction.rb', line 7 def gas_price @gas_price end |
#max_fee ⇒ Object
Returns the value of attribute max_fee.
7 8 9 |
# File 'lib/bluzelle/swarm/transaction.rb', line 7 def max_fee @max_fee end |
#max_gas ⇒ Object
Returns the value of attribute max_gas.
7 8 9 |
# File 'lib/bluzelle/swarm/transaction.rb', line 7 def max_gas @max_gas end |
#memo ⇒ Object
Returns the value of attribute memo.
7 8 9 |
# File 'lib/bluzelle/swarm/transaction.rb', line 7 def memo @memo end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/bluzelle/swarm/transaction.rb', line 6 def method @method end |
#retries_left ⇒ Object
Returns the value of attribute retries_left.
7 8 9 |
# File 'lib/bluzelle/swarm/transaction.rb', line 7 def retries_left @retries_left end |
Instance Method Details
#set_gas(gas_info) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/bluzelle/swarm/transaction.rb', line 19 def set_gas(gas_info) return if gas_info.nil? || !gas_info.is_a?(Hash) gas_info = Utils.stringify_keys(gas_info) @gas_price = gas_info['gas_price'].to_i if gas_info.key?('gas_price') @max_gas = gas_info['max_gas'].to_i if gas_info.key?('max_gas') @max_fee = gas_info['max_fee'].to_i if gas_info.key?('max_fee') end |