Class: DeployExecutableSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/serialization/deploy_executable_serializer.rb

Instance Method Summary collapse

Constructor Details

#initializeDeployExecutableSerializer



6
7
8
# File 'lib/serialization/deploy_executable_serializer.rb', line 6

def initialize 
  # @deploy_executable = Casper::Entity::DeployExecutable.new
end

Instance Method Details

#to_bytes(deploy_executable) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/serialization/deploy_executable_serializer.rb', line 10

def to_bytes(deploy_executable)
  if deploy_executable.module_bytes?
    deploy_executable.get_module_bytes.to_bytes
  elsif deploy_executable.stored_contract_by_hash?
    deploy_executable.stored_contract_by_hash.to_bytes
  elsif deploy_executable.stored_contract_by_name?
    deploy_executable.stored_contract_by_name.to_bytes
  elsif deploy_executable.stored_versioned_contract_by_hash?
    deploy_executable.stored_versioned_contract_by_hash.to_bytes
  elsif deploy_executable.stored_versioned_contract_by_name?
    deploy_executable.stored_versioned_contract_by_name.to_bytes
  elsif deploy_executable.transfer?
    deploy_executable.transfer.to_bytes
  end
end