PoC 7 updates
* Bloom * Block restructure * Receipts
This commit is contained in:
@ -15,6 +15,10 @@ type RlpEncodeDecode interface {
|
||||
RlpValue() []interface{}
|
||||
}
|
||||
|
||||
type RlpEncodable interface {
|
||||
RlpData() interface{}
|
||||
}
|
||||
|
||||
func Rlp(encoder RlpEncode) []byte {
|
||||
return encoder.RlpEncode()
|
||||
}
|
||||
@ -100,6 +104,8 @@ func Encode(object interface{}) []byte {
|
||||
switch t := object.(type) {
|
||||
case *Value:
|
||||
buff.Write(Encode(t.Raw()))
|
||||
case RlpEncodable:
|
||||
buff.Write(Encode(t.RlpData()))
|
||||
// Code dup :-/
|
||||
case int:
|
||||
buff.Write(Encode(big.NewInt(int64(t))))
|
||||
|
@ -377,6 +377,10 @@ func (val *Value) NewIterator() *ValueIterator {
|
||||
return &ValueIterator{value: val}
|
||||
}
|
||||
|
||||
func (it *ValueIterator) Len() int {
|
||||
return it.value.Len()
|
||||
}
|
||||
|
||||
func (it *ValueIterator) Next() bool {
|
||||
if it.idx >= it.value.Len() {
|
||||
return false
|
||||
|
Reference in New Issue
Block a user