Class: FlowClient::BlockSeal

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_client/block.rb

Overview

Represents a block seal

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBlockSeal

Returns a new instance of BlockSeal.



48
49
50
51
52
53
# File 'lib/flow_client/block.rb', line 48

def initialize
  @block_id = nil
  @execution_receipt_id = nil
  @execution_receipt_signatures = []
  @result_approval_signatures = []
end

Instance Attribute Details

#block_idObject

Returns the value of attribute block_id.



43
44
45
# File 'lib/flow_client/block.rb', line 43

def block_id
  @block_id
end

#execution_receipt_idObject

Returns the value of attribute execution_receipt_id.



43
44
45
# File 'lib/flow_client/block.rb', line 43

def execution_receipt_id
  @execution_receipt_id
end

#execution_receipt_signaturesObject

Returns the value of attribute execution_receipt_signatures.



43
44
45
# File 'lib/flow_client/block.rb', line 43

def execution_receipt_signatures
  @execution_receipt_signatures
end

#result_approval_signaturesObject

Returns the value of attribute result_approval_signatures.



43
44
45
# File 'lib/flow_client/block.rb', line 43

def result_approval_signatures
  @result_approval_signatures
end

Class Method Details

.parse_grpc_type(grpc_type) ⇒ Object



55
56
57
58
59
60
61
62
63
64
# File 'lib/flow_client/block.rb', line 55

def self.parse_grpc_type(grpc_type)
  block_seal = BlockSeal.new
  block_seal.block_id = grpc_type.block_id.unpack1("H*")
  block_seal.execution_receipt_id = grpc_type.execution_receipt_id.unpack1("H*")
  block_seal.execution_receipt_signatures = grpc_type.execution_receipt_signatures.to_a.map do |sig|
    sig.unpack1("H*")
  end
  block_seal.result_approval_signatures = grpc_type.result_approval_signatures.to_a.map { |sig| sig.unpack1("H*") }
  block_seal
end