mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
Added README docs for account/binary and renamed UInt -> Uint etc.
This commit is contained in:
+2
-2
@@ -55,7 +55,7 @@ func LoadState(db db_.DB) *State {
|
||||
return nil
|
||||
} else {
|
||||
r, n, err := bytes.NewReader(buf), new(int64), new(error)
|
||||
s.LastBlockHeight = ReadUVarInt(r, n, err)
|
||||
s.LastBlockHeight = ReadUvarint(r, n, err)
|
||||
s.LastBlockHash = ReadByteSlice(r, n, err)
|
||||
s.LastBlockParts = ReadBinary(PartSetHeader{}, r, n, err).(PartSetHeader)
|
||||
s.LastBlockTime = ReadTime(r, n, err)
|
||||
@@ -80,7 +80,7 @@ func (s *State) Save() {
|
||||
s.accounts.Save()
|
||||
s.validatorInfos.Save()
|
||||
buf, n, err := new(bytes.Buffer), new(int64), new(error)
|
||||
WriteUVarInt(s.LastBlockHeight, buf, n, err)
|
||||
WriteUvarint(s.LastBlockHeight, buf, n, err)
|
||||
WriteByteSlice(s.LastBlockHash, buf, n, err)
|
||||
WriteBinary(s.LastBlockParts, buf, n, err)
|
||||
WriteTime(s.LastBlockTime, buf, n, err)
|
||||
|
||||
+3
-3
@@ -25,10 +25,10 @@ func Tempfile(prefix string) (*os.File, string) {
|
||||
func RandAccount(randBalance bool, minBalance uint64) (*Account, *PrivAccount) {
|
||||
privAccount := GenPrivAccount()
|
||||
account := NewAccount(privAccount.PubKey)
|
||||
account.Sequence = RandUInt()
|
||||
account.Sequence = RandUint()
|
||||
account.Balance = minBalance
|
||||
if randBalance {
|
||||
account.Balance += uint64(RandUInt32())
|
||||
account.Balance += uint64(RandUint32())
|
||||
}
|
||||
return account, privAccount
|
||||
}
|
||||
@@ -38,7 +38,7 @@ func RandValidator(randBonded bool, minBonded uint64) (*ValidatorInfo, *PrivVali
|
||||
_, privVal.filename = Tempfile("priv_validator_")
|
||||
bonded := minBonded
|
||||
if randBonded {
|
||||
bonded += uint64(RandUInt32())
|
||||
bonded += uint64(RandUint32())
|
||||
}
|
||||
valInfo := &ValidatorInfo{
|
||||
Address: privVal.Address,
|
||||
|
||||
@@ -12,9 +12,9 @@ func randValidator_() *Validator {
|
||||
return &Validator{
|
||||
Address: RandBytes(20),
|
||||
PubKey: PubKeyEd25519{RandBytes(64)},
|
||||
BondHeight: uint(RandUInt32()),
|
||||
VotingPower: RandUInt64(),
|
||||
Accum: int64(RandUInt64()),
|
||||
BondHeight: uint(RandUint32()),
|
||||
VotingPower: RandUint64(),
|
||||
Accum: int64(RandUint64()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user