class Xooa::Response::TransactionResponse

Attributes

createdAt[RW]
creatorMspId[RW]
endorserMspId[RW]
readSet[RW]
smartContract[RW]
transactionId[RW]
transactionType[RW]
writeSet[RW]

Public Class Methods

new(transactionId, smartContract, creatorMspId, endorserMspId, transactionType, createdAt, readSet, writeSet) click to toggle source

Initialize TransactionResponse

# File lib/xooa/response/TransactionResponse.rb, line 38
def initialize(transactionId, smartContract, creatorMspId, endorserMspId, transactionType, createdAt, readSet, writeSet)
  @transactionId = transactionId
  @smartContract = smartContract
  @creatorMspId = creatorMspId
  @endorserMspId = endorserMspId
  @transactionType = transactionType
  @createdAt = createdAt
  @readSet = readSet
  @writeSet = writeSet
end

Public Instance Methods

display() click to toggle source

display TransactionResponse

# File lib/xooa/response/TransactionResponse.rb, line 50
def display
  puts("Transaction Id - #{@transactionId}")
  puts("Smart Contract - #{@smartContract}")
  puts("Creator MSP Id - #{@creatorMspId}")
  puts("Type - #{@transactionType}")
  puts("Created At - #{@createdAt}")

  puts("Endorser MSP ID -")
  if @endorserMspId.respond_to?("each")
    @endorserMspId.each do |id|
      puts("\t  #{id}")
    end
  end

  puts("ReadSet -")
  if @readSet.respond_to?("each")
    @readSet.each do |set|
      set.display
    end
  else
    @readSet.display
  end

  puts("WriteSet -")
  if @writeSet.respond_to?("each")
    @writeSet.each do |set|
      set.display
    end
  else
    @writeSet.display
  end
end