fix tests.
This commit is contained in:
parent
014d95454b
commit
2c839924c6
@ -154,7 +154,10 @@ func (ei *EventIndex) CollectEvents(ctx context.Context, te *TipSetEvents, rever
|
||||
}
|
||||
|
||||
isIndexedValue := func(b uint8) bool {
|
||||
return b&types.EventFlagIndexedValue == types.EventFlagIndexedValue
|
||||
// currently we mark the full entry as indexed if either the key
|
||||
// or the value are indexed; in the future we will need finer-grained
|
||||
// management of indices
|
||||
return b&(types.EventFlagIndexedKey|types.EventFlagIndexedValue) > 0
|
||||
}
|
||||
|
||||
for msgIdx, em := range ems {
|
||||
|
@ -18,7 +18,7 @@ func EncodeRLP(val interface{}) ([]byte, error) {
|
||||
}
|
||||
|
||||
func encodeRLPListItems(list []interface{}) (result []byte, err error) {
|
||||
var res []byte
|
||||
res := []byte{}
|
||||
for _, elem := range list {
|
||||
encoded, err := encodeRLP(elem)
|
||||
if err != nil {
|
||||
@ -165,7 +165,7 @@ func decodeLength(data []byte, lenInBytes int) (length int, err error) {
|
||||
|
||||
func decodeListElems(data []byte, length int) (res []interface{}, err error) {
|
||||
totalConsumed := 0
|
||||
var result []interface{}
|
||||
result := []interface{}{}
|
||||
|
||||
for i := 0; totalConsumed < length && i < maxListElements; i++ {
|
||||
elem, consumed, err := decodeRLP(data[totalConsumed:])
|
||||
|
Loading…
Reference in New Issue
Block a user