Commit 58a5d436 authored by vicotor's avatar vicotor

add exchain define

parent 145b3643
...@@ -8,6 +8,10 @@ type Wallet struct { ...@@ -8,6 +8,10 @@ type Wallet struct {
FrozenBalance uint256.Int `json:"frozenBalance"` FrozenBalance uint256.Int `json:"frozenBalance"`
} }
func (w *Wallet) AddBalance(balance uint256.Int) {
w.Balance = *new(uint256.Int).Add(&w.Balance, &balance)
}
type ProxyPublickey [64]byte type ProxyPublickey [64]byte
type AccountInfo struct { type AccountInfo struct {
......
...@@ -14,4 +14,15 @@ type StateDB interface { ...@@ -14,4 +14,15 @@ type StateDB interface {
} }
type ChainDB interface { type ChainDB interface {
AddCoin()
GetCoin()
AddPair()
GetPair()
} }
// todo: tx press test.
// limit, market, cancel 100w, each block 10w.
// serialize and unserialize.
// todo: add new struct.
// define Coin, Pair struct to store at chaindb.
// todo: define detail tx struct.
...@@ -51,13 +51,11 @@ type DepositTxData struct { ...@@ -51,13 +51,11 @@ type DepositTxData struct {
// From is exposed through the types.Signer, not through TxData // From is exposed through the types.Signer, not through TxData
From common.Address From common.Address
// nil means contract creation // nil means contract creation
To *common.Address `rlp:"nil"` To *common.Address
// Mint is minted on L2, locked on L1, nil if no minting. // Mint is minted on L2, locked on L1, nil if no minting.
Mint *big.Int `rlp:"nil"` Mint *big.Int
// Value is transferred from L2 balance, executed after Mint (if any) // Value is transferred from L2 balance, executed after Mint (if any)
Value *big.Int Value *big.Int
// gas limit
Gas uint64
// Field indicating if this transaction is exempt from the L2 gas limit. // Field indicating if this transaction is exempt from the L2 gas limit.
IsSystemTransaction bool IsSystemTransaction bool
// Normal Tx data // Normal Tx data
......
...@@ -13,5 +13,5 @@ type BlockHeader struct { ...@@ -13,5 +13,5 @@ type BlockHeader struct {
Proposer common.Address Proposer common.Address
} }
type BlockBody struct { type Coin struct{}
} type ExPair struct{}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment