Exception: TezosClient::ScriptRuntimeError

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

Constant Summary

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:) ⇒ ScriptRuntimeError

Returns a new instance of ScriptRuntimeError.



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

def initialize(metadata:, errors:, status:)
  error = errors[0]
  rejection_error = errors.detect { |error| error[:id] == "proto.003-PsddFKi3.scriptRejectedRuntimeError" }

  @location = rejection_error[:location]
  @contract =  error[:contractHandle]
  @with = rejection_error[:with]
  @message = "Script runtime Error when executing #{contract}: #{with} (location: #{location})"
  super
end

Instance Attribute Details

#contractObject (readonly)

Returns the value of attribute contract.



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

def contract
  @contract
end

#locationObject (readonly)

Returns the value of attribute location.



72
73
74
# File 'lib/tezos_client/exceptions.rb', line 72

def location
  @location
end

#withObject (readonly)

Returns the value of attribute with.



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

def with
  @with
end