-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exp/hubble: print state changes using stx and goxdr (#1922)
*** Condense above commits, from the Hubble initial commit. * Serialize using goxdr and stx, add build tags. * Update mod and sum. * Actually add build tags. * Update go list. * Delete old pretty printers. * Change panic to return error.
- Loading branch information
Showing
8 changed files
with
50 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build go1.13 | ||
|
||
package main | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build go1.13 | ||
|
||
package hubble | ||
|
||
import ( | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// +build go1.13 | ||
|
||
package hubble | ||
|
||
import ( | ||
"bytes" | ||
|
||
"github.com/stellar/go/xdr" | ||
goxdr "github.com/xdrpp/goxdr/xdr" | ||
"github.com/xdrpp/stc/stcdetail" | ||
"github.com/xdrpp/stc/stx" | ||
) | ||
|
||
func serializeLedgerEntryChange(lec xdr.LedgerEntryChange) ([]byte, error) { | ||
stxlec := stx.LedgerEntryChange{} | ||
lecbytes, err := lec.MarshalBinary() | ||
if err != nil { | ||
return []byte{}, err | ||
} | ||
stx.XDR_LedgerEntryChange(&stxlec).XdrMarshal(&goxdr.XdrIn{In: bytes.NewReader(lecbytes)}, "") | ||
j, err := stcdetail.XdrToJson(&stxlec) | ||
if err != nil { | ||
return []byte{}, err | ||
} | ||
return j, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters