mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
(U)VarInt binary methods; Txs have sequence numbers
This commit is contained in:
@@ -2,6 +2,7 @@ package state
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -12,6 +13,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrStateInvalidSequenceNumber = errors.New("Error State invalid sequence number")
|
||||
|
||||
stateKey = []byte("stateKey")
|
||||
)
|
||||
|
||||
@@ -87,9 +90,17 @@ func (s *State) Copy() *State {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CommitTx(tx *Tx) error {
|
||||
// May return ErrStateInvalidSequenceNumber
|
||||
func (s *State) CommitTx(tx Tx) error {
|
||||
s.mtx.Lock()
|
||||
defer s.mtx.Unlock()
|
||||
/*
|
||||
// Get the signer's incr
|
||||
signerId := tx.Signature().SignerId
|
||||
if mem.state.AccountSequence(signerId) != tx.Sequence() {
|
||||
return ErrStateInvalidSequenceNumber
|
||||
}
|
||||
*/
|
||||
// TODO commit the tx
|
||||
panic("Implement CommitTx()")
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user