Class: Fabric::TransactionInfo
- Inherits:
-
Object
- Object
- Fabric::TransactionInfo
- Defined in:
- lib/fabric/transaction_info.rb
Instance Attribute Summary collapse
-
#identity ⇒ Object
readonly
Returns the value of attribute identity.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#tx_id ⇒ Object
readonly
Returns the value of attribute tx_id.
Instance Method Summary collapse
-
#initialize(identity) ⇒ TransactionInfo
constructor
A new instance of TransactionInfo.
- #nonce_hex ⇒ Object
- #signature_header ⇒ Object
Constructor Details
#initialize(identity) ⇒ TransactionInfo
Returns a new instance of TransactionInfo.
5 6 7 8 9 |
# File 'lib/fabric/transaction_info.rb', line 5 def initialize(identity) @identity = identity @nonce = identity.crypto_suite.generate_nonce @tx_id = identity.crypto_suite.hexdigest(nonce + identity.serialize) end |
Instance Attribute Details
#identity ⇒ Object (readonly)
Returns the value of attribute identity.
3 4 5 |
# File 'lib/fabric/transaction_info.rb', line 3 def identity @identity end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
3 4 5 |
# File 'lib/fabric/transaction_info.rb', line 3 def nonce @nonce end |
#tx_id ⇒ Object (readonly)
Returns the value of attribute tx_id.
3 4 5 |
# File 'lib/fabric/transaction_info.rb', line 3 def tx_id @tx_id end |
Instance Method Details
#nonce_hex ⇒ Object
11 12 13 |
# File 'lib/fabric/transaction_info.rb', line 11 def nonce_hex identity.crypto_suite.encode_hex nonce end |
#signature_header ⇒ Object
15 16 17 |
# File 'lib/fabric/transaction_info.rb', line 15 def signature_header ::Common::SignatureHeader.new creator: identity.serialize, nonce: nonce end |