mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 00:27:38 +00:00
sharding tx base types override
Former-commit-id: b000e066b08f84dd40c251b30f36af125e2beaa8 [formerly 918447dfb6071e7346a737de737b510fad9607df] Former-commit-id: 821ec50c9b6149362ef3f7d3994cd23b99f0ded1
This commit is contained in:
parent
26778d7a35
commit
b336b6adfa
@ -1,6 +1,38 @@
|
|||||||
// 2018 Prysmatic Labs
|
// 2018 Prysmatic Labs
|
||||||
// This file is part of the prysmaticlabs/geth-sharding library.
|
// This file is part of the prysmaticlabs/geth-sharding library.
|
||||||
//
|
//
|
||||||
// This file overrides the default protocol transaction interface
|
// This file overrides the default protocol transaction interface to prep it
|
||||||
|
// for sharding
|
||||||
|
|
||||||
package sharding
|
package sharding
|
||||||
|
|
||||||
|
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:"-"`
|
||||||
|
}
|
||||||
|
15
sharding/transactions_test.go
Normal file
15
sharding/transactions_test.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package sharding
|
||||||
|
|
||||||
|
import (
|
||||||
|
//"flag"
|
||||||
|
//"fmt"
|
||||||
|
//"math/rand"
|
||||||
|
//"os"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCreation(t *testing.T) {
|
||||||
|
if 1 != 2 {
|
||||||
|
t.Fatalf("Values are not equal")
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user