Merge PR #2405: Unbonding and Redelegations Queue

This commit is contained in:
Sunny Aggarwal
2018-10-08 06:43:47 +02:00
committed by Christopher Goes
parent d661ccb30e
commit cd21427a7b
23 changed files with 376 additions and 546 deletions
+7
View File
@@ -4,6 +4,7 @@ package types
import (
"context"
"sync"
"time"
"github.com/golang/protobuf/proto"
@@ -181,6 +182,12 @@ func (c Context) WithBlockHeader(header abci.Header) Context {
return c.withValue(contextKeyBlockHeader, header)
}
func (c Context) WithBlockTime(newTime time.Time) Context {
newHeader := c.BlockHeader()
newHeader.Time = newTime
return c.WithBlockHeader(newHeader)
}
func (c Context) WithBlockHeight(height int64) Context {
return c.withValue(contextKeyBlockHeight, height)
}
+7
View File
@@ -306,6 +306,13 @@ func PrefixEndBytes(prefix []byte) []byte {
return end
}
// InclusiveEndBytes returns the []byte that would end a
// range query such that the input would be included
func InclusiveEndBytes(inclusiveBytes []byte) (exclusiveBytes []byte) {
exclusiveBytes = append(inclusiveBytes, byte(0x00))
return exclusiveBytes
}
// TransientStoreKey is used for indexing transient stores in a MultiStore
type TransientStoreKey struct {
name string