more explicity payload err and msg
This commit is contained in:
@@ -38,6 +38,11 @@ type IPLDPayload struct {
|
||||
StorageNodes map[common.Hash][]TrieNode
|
||||
}
|
||||
|
||||
// Height satisfies the StreamedIPLDs interface
|
||||
func (i IPLDPayload) Height() int64 {
|
||||
return i.Block.Number().Int64()
|
||||
}
|
||||
|
||||
// Trie struct used to flag node as leaf or not
|
||||
type TrieNode struct {
|
||||
Key common.Hash
|
||||
@@ -99,6 +104,11 @@ type StreamResponse struct {
|
||||
err error
|
||||
}
|
||||
|
||||
// Height satisfies the ServerResponse interface
|
||||
func (sr StreamResponse) Height() int64 {
|
||||
return sr.BlockNumber.Int64()
|
||||
}
|
||||
|
||||
func (sr *StreamResponse) ensureEncoded() {
|
||||
if sr.encoded == nil && sr.err == nil {
|
||||
sr.encoded, sr.err = json.Marshal(sr)
|
||||
|
||||
Reference in New Issue
Block a user