-
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.
- Loading branch information
Showing
17 changed files
with
17,394 additions
and
4 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
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,8 @@ | ||
#! /bin/bash | ||
set -e | ||
|
||
printf "Running make gxdr/xdr_generated.go...\n" | ||
make gxdr/xdr_generated.go | ||
|
||
printf "Checking for no diff...\n" | ||
git diff --exit-code || (echo "Files changed after running make gxdr/xdr_generated.go. Run make gxdr/xdr_generated.go locally and update generated files." && exit 1) |
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
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,25 @@ | ||
package gxdr | ||
|
||
import ( | ||
"bytes" | ||
"encoding" | ||
|
||
goxdr "github.com/xdrpp/goxdr/xdr" | ||
) | ||
|
||
// Dump serializes the given goxdr value into binary. | ||
func Dump(v goxdr.XdrType) []byte { | ||
var buf bytes.Buffer | ||
writer := goxdr.XdrOut{Out: &buf} | ||
writer.Marshal("", v) | ||
return buf.Bytes() | ||
} | ||
|
||
// Convert serializes the given goxdr value into another destination value | ||
// which supports binary unmarshalling. | ||
// | ||
// This function can be used to convert github.com/xdrpp/goxdr/xdr values into | ||
// equivalent https://github.com/stellar/go-xdr values. | ||
func Convert(src goxdr.XdrType, dest encoding.BinaryUnmarshaler) error { | ||
return dest.UnmarshalBinary(Dump(src)) | ||
} |
Oops, something went wrong.