Sha256: 798f3843d6184ab09a74c760b7e191d1a6763670148fa40a4e3f373816d6e156

Contents?: true

Size: 890 Bytes

Versions: 2

Compression:

Stored size: 890 Bytes

Contents

module FlowClient
  class Collection
    attr_accessor :id, :transaction_ids

    def initialize
      @id = nil
      @transaction_ids = []
    end

    def self.parse_grpc_type(grpc_type)
      collection = Collection.new
      collection.id = grpc_type.collection.id.unpack1("H*")
      collection.transaction_ids = grpc_type.collection.transaction_ids.to_a.map { |tid| tid.unpack1("H*") }
      collection
    end
  end

  class CollectionGuarantee
    attr_accessor :collection_id, :signatures

    def initialize
      @collection_id = nil
      @signatures = []
    end

    def self.parse_grpc_type(grpc_type)
      collection_guarantee = CollectionGuarantee.new
      collection_guarantee.collection_id = grpc_type.collection_id.unpack1("H*")
      collection_guarantee.signatures = grpc_type.signatures.to_a.map { |s| s.unpack1("H*") }
      collection_guarantee
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flow_client-0.2.1 lib/flow_client/collection.rb
flow_client-0.2.0 lib/flow_client/collection.rb