Exception: TezosClient::TezBalanceTooLow

Inherits:
OperationFailure show all
Defined in:
lib/tezos_client/exceptions.rb

Constant Summary collapse

FIRST_ERROR_REGEXP =
/proto\.[^.]*\.contract\.balance_too_low/

Constants included from Logger

Logger::FILTERED_KEYS

Instance Attribute Summary collapse

Attributes inherited from OperationFailure

#errors, #message, #metadata, #status

Instance Method Summary collapse

Methods included from Logger

#log, #tezos_contents_log, #tezos_contents_log_filter

Constructor Details

#initialize(metadata:, errors:, status:) ⇒ TezBalanceTooLow

Returns a new instance of TezBalanceTooLow.



78
79
80
81
82
83
84
85
86
87
# File 'lib/tezos_client/exceptions.rb', line 78

def initialize(metadata:, errors:, status:)
  error = errors[0]
  @contract = error[:contract]
  @balance = error[:balance]
  @amount = error[:amount]

  @message = "Tezos balance too low for address #{contract} (balance: #{balance}, amount #{amount})"

  super
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



76
77
78
# File 'lib/tezos_client/exceptions.rb', line 76

def amount
  @amount
end

#balanceObject (readonly)

Returns the value of attribute balance.



75
76
77
# File 'lib/tezos_client/exceptions.rb', line 75

def balance
  @balance
end

#contractObject (readonly)

Returns the value of attribute contract.



74
75
76
# File 'lib/tezos_client/exceptions.rb', line 74

def contract
  @contract
end