2018-01-15 22:53:42 +00:00
|
|
|
// 2018 Prysmatic Labs
|
|
|
|
// This file is part of the prysmaticlabs/geth-sharding library.
|
|
|
|
//
|
2018-01-16 16:41:00 +00:00
|
|
|
// This file overrides the default protocol transaction interface to prep it
|
|
|
|
// for sharding
|
2018-01-15 22:53:42 +00:00
|
|
|
|
|
|
|
package sharding
|
2018-01-16 16:41:00 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"math/big"
|
|
|
|
"sync/atomic"
|
|
|
|
//"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
//"github.com/ethereum/go-ethereum/rlp"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Transaction Base Sharding Struct
|
|
|
|
type Transaction struct {
|
|
|
|
data txdata
|
|
|
|
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"`
|
|
|
|
// Code Payload
|
|
|
|
Payload []byte `json:"input" gencodec:"required"`
|
|
|
|
// TODO:
|
|
|
|
// add accesslist, chainid, shardid,
|
|
|
|
|
|
|
|
// This is only used when marshaling to JSON.
|
|
|
|
Hash *common.Hash `json:"hash" rlp:"-"`
|
|
|
|
}
|