Merge PR #2405: Unbonding and Redelegations Queue
This commit is contained in:
committed by
Christopher Goes
parent
d661ccb30e
commit
cd21427a7b
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user