syntax = "proto3";

package base.v1;

import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
// import "base/v1/options.proto";

message Bytes32 {
  bytes data = 1;
}

message BigInt {
  bytes data = 1;
}

message Hash {
  bytes hash = 1;
}

message Address {
  bytes address = 1;
}


// // Lengths of hashes and addresses in bytes.
// const (
// 	// HashLength is the expected length of the hash
// 	HashLength = 32
// 	// AddressLength is the expected length of the address
// 	AddressLength = 20
// )

message EthTransaction {
  Txdata  Inner = 1;
  google.protobuf.Timestamp time =2;  
}
  
message Txdata{
    uint64  account_nonce =1;
    bytes   price =2 ;
    uint64  gas_limit =3;
    Address recipient =4;  
    bytes   amount =5;
    bytes   payload =6;
    bytes   v =7;
    bytes   r=8;
    bytes   s=9;
//This is only used when marshaling to JSON.
    Hash    hash=10;
}

message CheckTx {
   google.protobuf.Any tx = 1;
   Address  from =2;
}

message transaction{
  bytes rset = 1;
  bytes wset = 2;
  bytes proof =3;
  int64 state_block_num =4;
  int64 timeout_block_num =5;
  CheckTx check_tx =6;
}
  
//ype checkTx struct{
//  tx  interface
// 	From []byte
//  type 
//}


// type tx struct{
//  checkTx  
//  wset []byte 
//  rset []byte 
//  proof  []byte 
//  stateblocknum int64
// }
  

// type Transaction struct {
//   data txdata    // Consensus contents of a transaction
//   time time.Time // Time first seen locally (spam avoidance)

//   // caches
//   hash atomic.Value
//   size atomic.Value
//   from atomic.Value
// }

// type txdata struct {
//   AccountNonce uint64          `json:"nonce"    gencodec:"required"`
//   Price        *big.Int        `json:"gasPrice" gencodec:"required"`
//   GasLimit     uint64          `json:"gas"      gencodec:"required"`
//   Recipient    *common.Address `json:"to"       rlp:"nil"` // nil means contract creation
//   Amount       *big.Int        `json:"value"    gencodec:"required"`
//   Payload      []byte          `json:"input"    gencodec:"required"`

//   // Signature values
//   V *big.Int `json:"v" gencodec:"required"`
//   R *big.Int `json:"r" gencodec:"required"`
//   S *big.Int `json:"s" gencodec:"required"`

//   // This is only used when marshaling to JSON.
//   Hash *common.Hash `json:"hash" rlp:"-"`
// }