Class: Casper::Entity::DeployExecutableTransfer
- Inherits:
-
DeployExecutableItemInternal
- Object
- DeployExecutableItemInternal
- Casper::Entity::DeployExecutableTransfer
- Defined in:
- lib/entity/deploy_executable_transfer.rb
Overview
A native transfer which does not contain or reference a Wasm code.
Instance Attribute Summary
Attributes inherited from DeployExecutableItemInternal
Instance Method Summary collapse
- #get_args ⇒ Object
- #get_tag ⇒ Object
-
#initialize(args) ⇒ DeployExecutableTransfer
constructor
A new instance of DeployExecutableTransfer.
- #to_bytes ⇒ Object
Methods inherited from DeployExecutableItemInternal
Constructor Details
#initialize(args) ⇒ DeployExecutableTransfer
Returns a new instance of DeployExecutableTransfer.
24 25 26 27 |
# File 'lib/entity/deploy_executable_transfer.rb', line 24 def initialize(args) @tag = 5 @args = args end |
Instance Method Details
#get_args ⇒ Object
33 34 35 |
# File 'lib/entity/deploy_executable_transfer.rb', line 33 def get_args @args end |
#get_tag ⇒ Object
29 30 31 |
# File 'lib/entity/deploy_executable_transfer.rb', line 29 def get_tag @tag end |
#to_bytes ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/entity/deploy_executable_transfer.rb', line 37 def to_bytes serializer = DeployNamedArgSerializer.new num_of_args = @args.length bytes = Utils::ByteUtils.to_u8(@tag) + Utils::ByteUtils.to_u32(num_of_args) @args.each do |arg| arg.each do |item| bytes += serializer.to_bytes(item) end end Utils::ByteUtils.hex_to_byte_array(bytes) end |