Class: TezosClient::SmartpyInterface

Inherits:
Object
  • Object
show all
Includes:
Logger, SmartpyWrapper
Defined in:
lib/tezos_client/smartpy_interface.rb,
lib/tezos_client/smartpy_inteface/smartpy_wrapper.rb

Defined Under Namespace

Modules: SmartpyWrapper

Constant Summary

Constants included from Logger

Logger::FILTERED_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SmartpyWrapper

#call_smartpy, #smartpy_cmd

Methods included from Logger

#log, #tezos_contents_log, #tezos_contents_log_filter

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/tezos_client/smartpy_interface.rb', line 10

def options
  @options
end

Instance Method Details

#json_scripts(args) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/tezos_client/smartpy_interface.rb', line 12

def json_scripts(args)
  compile_to_michelson(args) do |contract_script_filename, init_script_filename|
    micheline_contract = File.read(contract_script_filename)
    micheline_storage = File.read(init_script_filename)

    [JSON.parse(micheline_storage), JSON.parse(micheline_contract)]
  end
end

#origination_script(args) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/tezos_client/smartpy_interface.rb', line 21

def origination_script(args)
  json_init_script, json_contract_script = json_scripts(args)

  {
    code: json_contract_script,
    storage: json_init_script
  }
end