Class: BSV::Network::BroadcastResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/network/broadcast_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ BroadcastResponse

Returns a new instance of BroadcastResponse.



8
9
10
11
12
13
14
15
16
17
# File 'lib/bsv/network/broadcast_response.rb', line 8

def initialize(attrs = {})
  @txid = attrs[:txid]
  @tx_status = attrs[:tx_status]
  @message = attrs[:message]
  @extra_info = attrs[:extra_info]
  @block_hash = attrs[:block_hash]
  @block_height = attrs[:block_height]
  @timestamp = attrs[:timestamp]
  @competing_txs = attrs[:competing_txs]
end

Instance Attribute Details

#block_hashObject (readonly)

Returns the value of attribute block_hash.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def block_hash
  @block_hash
end

#block_heightObject (readonly)

Returns the value of attribute block_height.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def block_height
  @block_height
end

#competing_txsObject (readonly)

Returns the value of attribute competing_txs.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def competing_txs
  @competing_txs
end

#extra_infoObject (readonly)

Returns the value of attribute extra_info.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def extra_info
  @extra_info
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def message
  @message
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def timestamp
  @timestamp
end

#tx_statusObject (readonly)

Returns the value of attribute tx_status.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def tx_status
  @tx_status
end

#txidObject (readonly)

Returns the value of attribute txid.



6
7
8
# File 'lib/bsv/network/broadcast_response.rb', line 6

def txid
  @txid
end

Instance Method Details

#mined?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/bsv/network/broadcast_response.rb', line 23

def mined?
  tx_status == 'MINED'
end

#success?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/bsv/network/broadcast_response.rb', line 19

def success?
  true
end