Class: Lorentz::Contract::Call
- Defined in:
- lib/lorentz/contract/param.rb
Instance Attribute Summary collapse
-
#burn_cap ⇒ Object
Returns the value of attribute burn_cap.
-
#config ⇒ Object
Returns the value of attribute config.
-
#contract_address ⇒ Object
Returns the value of attribute contract_address.
-
#expect_failure ⇒ Object
Returns the value of attribute expect_failure.
Attributes inherited from Param
#command, #storage_command, #storage_params
Instance Method Summary collapse
- #contract_call(tezos_client, contract_call_alias) ⇒ Object
- #contract_call_cmd(tezos_client, contract_call_alias) ⇒ Object
-
#initialize(config, contract_address, command, parameters, burn_cap, expect_failure = false) ⇒ Call
constructor
A new instance of Call.
- #michelson_parameters ⇒ Object
Methods inherited from Param
all_names, find_originated_contract, find_ran_call, from_yaml, #in_path, init_originated_contracts, #originate, #originate_cmd, originated_contracts_path, #path, #print, recursive_yaml, save_originated_contracts, #stack_exec, #stack_path, #storage
Methods included from Kernel
#system_line, #system_lines, #system_operation_hash
Constructor Details
#initialize(config, contract_address, command, parameters, burn_cap, expect_failure = false) ⇒ Call
300 301 302 303 304 305 306 307 |
# File 'lib/lorentz/contract/param.rb', line 300 def initialize(config, contract_address, command, parameters, burn_cap, expect_failure=false) @config = config @contract_address = contract_address @storage_command = command @storage_params = parameters @burn_cap = burn_cap @expect_failure = expect_failure.to_s.match(/t(rue)?/i) end |
Instance Attribute Details
#burn_cap ⇒ Object
Returns the value of attribute burn_cap.
298 299 300 |
# File 'lib/lorentz/contract/param.rb', line 298 def burn_cap @burn_cap end |
#config ⇒ Object
Returns the value of attribute config.
298 299 300 |
# File 'lib/lorentz/contract/param.rb', line 298 def config @config end |
#contract_address ⇒ Object
Returns the value of attribute contract_address.
298 299 300 |
# File 'lib/lorentz/contract/param.rb', line 298 def contract_address @contract_address end |
#expect_failure ⇒ Object
Returns the value of attribute expect_failure.
298 299 300 |
# File 'lib/lorentz/contract/param.rb', line 298 def expect_failure @expect_failure end |
Instance Method Details
#contract_call(tezos_client, contract_call_alias) ⇒ Object
332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/lorentz/contract/param.rb', line 332 def contract_call(tezos_client, contract_call_alias) begin tezos_client.contract_call(self.contract_address, self.michelson_parameters, self.burn_cap) rescue Lorentz::Contract::Kernel::SystemError => e if self.expect_failure return { 'error_message': e..map(&:chomp) } else raise e end end end |
#contract_call_cmd(tezos_client, contract_call_alias) ⇒ Object
326 327 328 329 330 |
# File 'lib/lorentz/contract/param.rb', line 326 def contract_call_cmd(tezos_client, contract_call_alias) tezos_client.contract_call_cmd(self.contract_address, self.michelson_parameters, self.burn_cap) end |
#michelson_parameters ⇒ Object
322 323 324 |
# File 'lib/lorentz/contract/param.rb', line 322 def michelson_parameters Param.instance_method(:storage).bind(self).call(Param.all_names) end |