Skip to content

Transaction Tests

winsvega edited this page Jan 5, 2015 · 7 revisions

##Transaction Test

Describes a complete transaction and it's rlp representation using the .json file The client should check whether the transaction is valid, has the correct sender and corresponds to the given rlp. If it is an invalid transaction, the transaction and the sender object will be missing.

###Basic structure

{  
   "transactionTest1": {  
      "rlp" : "bytearray",  
      "sender" : "address",  
      "transaction" : {  
            "nonce" : "int",  
            "gasPrice" : "int",  
            "gasLimit" : "int",  
            "to" : "address",  
            "value" : "int",  
            "v" : "byte",  
            "r" : "256 bit unsigned int",  
            "s" : "256 bit unsigned int",   
            "data" : "byte array"  
      }
   },

   "invalidTransactionTest": {
      "rlp" : "bytearray",
   },
   ...
}

###Sections

  • rlp - RLP encoded data of this transaction
  • transaction - transaction described by fields
  • nonce - A scalar value equal to the number of transactions sent by the sender.
  • gasPrice - A scalar value equal to the number of Wei to be paid per unit of gas.
  • gasLimit - A scalar value equal to the maximum amount of gas that should be used in executing this transaction.
  • to - The 160-bit address of the message call's recipient or empty for a contract creation transaction.
  • value - A scalar value equal to the number of Wei to be transferred to the message call's recipient or, in the case of contract creation, as an endowment to the newly created account.
  • v, r, s - Values corresponding to the signature of the transaction and used to determine the sender of the transaction.
  • sender - the address of the sender, derived from the v,r,s values.