Class: Glueby::Contract::Timestamp::Syncer

Inherits:
Object
  • Object
show all
Defined in:
lib/glueby/contract/timestamp/syncer.rb

Instance Method Summary collapse

Instance Method Details

#block_sync(block) ⇒ Object



5
6
7
8
9
# File 'lib/glueby/contract/timestamp/syncer.rb', line 5

def block_sync(block)
  Glueby::Contract::AR::Timestamp
    .where(txid: block.transactions.map(&:txid), status: :unconfirmed)
    .update_all(status: :confirmed, block_height: block.height, block_time: block.header.time)
end