lib/eth/tx/legacy.rb
# Creates an unsigned copy of a transaction.
#
# @param tx [Eth::Tx::Legacy] an legacy transaction object.
# @return [Eth::Tx::Legacy] an unsigned transaction object.
# @raise [TransactionTypeError] if transaction type does not match.
Creates an unsigned copy of a transaction.
Creates an unsigned copy of a transaction .
def unsigned_copy(tx)
        raise TransactionTypeError, "Cannot copy transaction of different type!" unless tx.instance_of? Tx::Legacy
        @signer_nonce = tx.signer_nonce
        @gas_price = tx.gas_price
        @gas_limit = tx.gas_limit
        @destination = tx.destination
        @amount = tx.amount
        @payload = tx.payload
        @chain_id = tx.chain_id
        _set_signature(tx.chain_id, 0, 0)
        @sender = Tx.sanitize_address nil
        @type = TYPE_LEGACY
      end
def unsigned_copy ( tx ) raise TransactionTypeError , "Cannot copy transaction of different type!" unless tx . instance_of? Tx :: Legacy @signer_nonce = tx . signer_nonce @gas_price = tx . gas_price @gas_limit = tx . gas_limit @destination = tx . destination @amount = tx . amount @payload = tx . payload @chain_id = tx . chain_id _set_signature ( tx . chain_id , 0 , 0 ) @sender = Tx . sanitize_address nil @type = TYPE_LEGACY end
Creates an unsigned copy of a transaction.
Creates an unsigned copy of a transaction .
# not checking transaction validity unless it's of a different class # populate class attributes # force-set signature to unsigned # keep the 'from' field blank # last but not least, set the type.
an unsigned transaction object.
an unsigned transaction object .
Eth::Tx::Legacy
[TransactionTypeError] if transaction type does not match.
[ TransactionTypeError ] if transaction type does not match .
tx
an legacy transaction object.
an legacy transaction object .