Sha256: dc5394f9e3547d86afd7ca49c9814ba046d17d9d1e9b98f40a9e8899ac045734

Contents?: true

Size: 710 Bytes

Versions: 9

Compression:

Stored size: 710 Bytes

Contents

module Glueby
  module Contract
    class Timestamp
      module TxBuilder
        class Trackable < Simple
          attr_reader :p2c_address, :payment_base

          # @override
          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

          private

          def input_amount
            super + P2C_DEFAULT_VALUE
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
glueby-1.4.0 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.3.0 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.3 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.2 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.1 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.0 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.0.beta.3 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.0.beta.2 lib/glueby/contract/timestamp/tx_builder/trackable.rb
glueby-1.2.0.beta.1 lib/glueby/contract/timestamp/tx_builder/trackable.rb