This commit is contained in:
Jeffrey Picard 2021-12-14 18:40:04 -05:00
parent 76f56c163a
commit 9a0a44e688
2 changed files with 17 additions and 40 deletions

View file

@ -173,6 +173,7 @@ func UnpackGenericValue(key, value []byte) (byte, interface{}, error) {
func NewIterateOptions() *IterOptions {
return &IterOptions{
FillCache: false,
Prefix: []byte{},
Start: nil,
Stop: nil,
IncludeStart: true,
@ -189,6 +190,11 @@ func (o *IterOptions) WithFillCache(fillCache bool) *IterOptions {
return o
}
func (o *IterOptions) WithPrefix(prefix []byte) *IterOptions {
o.Prefix = prefix
return o
}
func (o *IterOptions) WithStart(start []byte) *IterOptions {
o.Start = start
return o
@ -219,6 +225,16 @@ func (o *IterOptions) WithIncludeValue(includeValue bool) *IterOptions {
return o
}
func (o *IterOptions) WithRawKey(rawKey bool) *IterOptions {
o.RawKey = rawKey
return o
}
func (o *IterOptions) WithRawValue(rawValue bool) *IterOptions {
o.RawValue = rawValue
return o
}
func (k *UTXOKey) String() string {
return fmt.Sprintf(
"%s(hashX=%s, tx_num=%d, nout=%d)",

View file

@ -1,45 +1,6 @@
package prefixes
const (
//ClaimToSupport = []byte("K")
//SupportToClaim = []byte("L")
//
//ClaimToTXO = []byte("E")
//TXOToClaim = []byte("G")
//
//ClaimToChannel = []byte("I")
//ChannelToClaim = []byte("J")
//
//ClaimShortIdPrefix = []byte("F")
//EffectiveAmount = []byte("D")
//ClaimExpiration = []byte("O")
//
//ClaimTakeover = []byte("P")
//PendingActivation = []byte("Q")
//ActivatedClaimAndSupport = []byte("R")
//ActiveAmount = []byte("S")
//
//Repost = []byte("V")
//RepostedClaim = []byte("W")
//
//Undo = []byte("M")
//ClaimDiff = []byte("Y")
//
//Tx = []byte("B")
//BlockHash = []byte("C")
//Header = []byte("H")
//TxNum = []byte("N")
//TxCount = []byte("T")
//TxHash = []byte("X")
//UTXO = []byte("u")
//HashXUTXO = []byte("h")
//HashXHistory = []byte("x")
//DBState = []byte("s")
//ChannelCount = []byte("Z")
//SupportAmount = []byte("a")
//BlockTXs = []byte("b")
ClaimToSupport = 'K'
SupportToClaim = 'L'
@ -53,10 +14,10 @@ const (
EffectiveAmount = 'D'
ClaimExpiration = 'O'
ActiveAmount = 'S'
ClaimTakeover = 'P'
PendingActivation = 'Q'
ActivatedClaimAndSupport = 'R'
ActiveAmount = 'S'
Repost = 'V'
RepostedClaim = 'W'