Class: Glueby::Contract::Timestamp::TxBuilder::Trackable

Inherits:
Simple
  • Object
show all
Defined in:
lib/glueby/contract/timestamp/tx_builder/trackable.rb

Direct Known Subclasses

UpdatingTrackable

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Simple

#build, #funding_tx, #initialize, #set_inputs

Constructor Details

This class inherits a constructor from Glueby::Contract::Timestamp::TxBuilder::Simple

Instance Attribute Details

#p2c_addressObject (readonly)

Returns the value of attribute p2c_address.



6
7
8
# File 'lib/glueby/contract/timestamp/tx_builder/trackable.rb', line 6

def p2c_address
  @p2c_address
end

#payment_baseObject (readonly)

Returns the value of attribute payment_base.



6
7
8
# File 'lib/glueby/contract/timestamp/tx_builder/trackable.rb', line 6

def payment_base
  @payment_base
end

Instance Method Details

#set_data(prefix, data) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/glueby/contract/timestamp/tx_builder/trackable.rb', line 9

def set_data(prefix, data)
  @prefix = prefix
  @data = data

  # Create a new trackable timestamp
  @p2c_address, @payment_base = @wallet.internal_wallet
                                       .create_pay_to_contract_address([prefix, data].join)
  @txb.pay(p2c_address, P2C_DEFAULT_VALUE)
  self
end