Class: Casper::Entity::StoredContractByName
- Inherits:
-
DeployExecutableItemInternal
- Object
- DeployExecutableItemInternal
- Casper::Entity::StoredContractByName
- Defined in:
- lib/entity/stored_contract_by_name.rb
Instance Attribute Summary
Attributes inherited from DeployExecutableItemInternal
Instance Method Summary collapse
- #get_args ⇒ Object
- #get_entry_point ⇒ Object
- #get_name ⇒ Object
- #get_tag ⇒ Object
-
#initialize(name, entry_point, args) ⇒ StoredContractByName
constructor
A new instance of StoredContractByName.
- #to_bytes ⇒ Object
Methods inherited from DeployExecutableItemInternal
Constructor Details
#initialize(name, entry_point, args) ⇒ StoredContractByName
10 11 12 13 14 15 |
# File 'lib/entity/stored_contract_by_name.rb', line 10 def initialize(name, entry_point, args) @tag = 2 @name = name @entry_point = entry_point @args = args end |
Instance Method Details
#get_args ⇒ Object
29 30 31 |
# File 'lib/entity/stored_contract_by_name.rb', line 29 def get_args @args end |
#get_entry_point ⇒ Object
25 26 27 |
# File 'lib/entity/stored_contract_by_name.rb', line 25 def get_entry_point @entry_point end |
#get_name ⇒ Object
21 22 23 |
# File 'lib/entity/stored_contract_by_name.rb', line 21 def get_name @name end |
#get_tag ⇒ Object
17 18 19 |
# File 'lib/entity/stored_contract_by_name.rb', line 17 def get_tag @tag end |
#to_bytes ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/entity/stored_contract_by_name.rb', line 34 def to_bytes serializer = DeployNamedArgSerializer.new num_of_args = @args.length bytes = Utils::ByteUtils.to_u8(@tag) bytes += CLValueBytesParsers::CLStringBytesParser.to_bytes(@name) bytes += CLValueBytesParsers::CLStringBytesParser.to_bytes(@entry_point) bytes += 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 |