Class: TransactionReceipt
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- TransactionReceipt
- Defined in:
- lib/facetq/models/transaction_receipt.rb
Overview
ApplicationRecord
Instance Method Summary collapse
- #address ⇒ Object
- #as_json(options = {}) ⇒ Object
- #contract ⇒ Object
- #contract_address ⇒ Object
- #failure? ⇒ Boolean
- #from ⇒ Object
- #success? ⇒ Boolean
- #to ⇒ Object
- #to_or_contract_address ⇒ Object
Instance Method Details
#address ⇒ Object
65 66 67 |
# File 'lib/facetq/models/transaction_receipt.rb', line 65 def address effective_contract_address end |
#as_json(options = {}) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/facetq/models/transaction_receipt.rb', line 85 def as_json( = {}) super( .merge( only: [ :transaction_hash, :call_type, :runtime_ms, :block_timestamp, :status, :function, :args, :error, :logs, :block_blockhash, :block_number, :transaction_index, :gas_price, :gas_used, :transaction_fee, :return_value, :effective_contract_address ], methods: [:to, :from, :contract_address, :to_or_contract_address] ) ).with_indifferent_access end |
#contract ⇒ Object
61 62 63 |
# File 'lib/facetq/models/transaction_receipt.rb', line 61 def contract Contract.find_by_address(address) end |
#contract_address ⇒ Object
77 78 79 |
# File 'lib/facetq/models/transaction_receipt.rb', line 77 def contract_address created_contract_address end |
#failure? ⇒ Boolean
112 113 114 |
# File 'lib/facetq/models/transaction_receipt.rb', line 112 def failure? status.to_s == 'failure' end |
#from ⇒ Object
73 74 75 |
# File 'lib/facetq/models/transaction_receipt.rb', line 73 def from from_address end |
#success? ⇒ Boolean
116 117 118 |
# File 'lib/facetq/models/transaction_receipt.rb', line 116 def success? status.to_s == 'success' end |
#to ⇒ Object
69 70 71 |
# File 'lib/facetq/models/transaction_receipt.rb', line 69 def to to_contract_address end |
#to_or_contract_address ⇒ Object
81 82 83 |
# File 'lib/facetq/models/transaction_receipt.rb', line 81 def to_or_contract_address to || contract_address end |