Class: ContractTransaction

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/facetq/models/contract_transaction.rb

Overview

Schema Information

Table name: contract_transactions

id                :bigint           not null, primary key
transaction_hash  :string           not null
block_blockhash   :string           not null
block_timestamp   :bigint           not null
block_number      :bigint           not null
transaction_index :bigint           not null
created_at        :datetime         not null
updated_at        :datetime         not null

Indexes

index_contract_transactions_on_transaction_hash  (transaction_hash) UNIQUE
index_contract_txs_on_block_number_and_tx_index  (block_number,transaction_index) UNIQUE

Foreign Keys

fk_rails_...  (block_number => eth_blocks.block_number) ON DELETE => cascade
fk_rails_...  (transaction_hash => ethscriptions.transaction_hash) ON DELETE => cascade

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#payloadObject

Returns the value of attribute payload.



33
34
35
# File 'lib/facetq/models/contract_transaction.rb', line 33

def payload
  @payload
end

#tx_originObject

Returns the value of attribute tx_origin.



33
34
35
# File 'lib/facetq/models/contract_transaction.rb', line 33

def tx_origin
  @tx_origin
end

Class Method Details

.transaction_mimetypeObject



35
36
37
# File 'lib/facetq/models/contract_transaction.rb', line 35

def self.transaction_mimetype
  "application/vnd.facet.tx+json"
end

Instance Method Details

#statusObject



42
43
44
# File 'lib/facetq/models/contract_transaction.rb', line 42

def status
  contract_calls.any?(&:failure?) ? :failure : :success
end