-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump version in spec PDF * Succinct is now 'O(poly(log n))' * Start Go test shim * Fix 'timeoutOnClose' * Fix connection version negotiation * Add file describing encoding * Update proto3 files; rebuild
- Loading branch information
Showing
13 changed files
with
119 additions
and
186 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"os" | ||
) | ||
|
||
type Arg string | ||
|
||
type Value string | ||
|
||
type Test struct { | ||
Name string `json:"name"` | ||
Function string `json:"function"` | ||
Args []Arg `json:"args"` | ||
Result Value `json:"result"` | ||
} | ||
|
||
func run(t Test) error { | ||
fmt.Printf("Ran test %s\n", t.Name) | ||
return nil | ||
} | ||
|
||
func main() { | ||
fh, err := os.Open(os.Args[1]) | ||
if err != nil { | ||
panic(err) | ||
} | ||
bytes, err := ioutil.ReadAll(fh) | ||
if err != nil { | ||
panic(err) | ||
} | ||
var tests []Test | ||
err = json.Unmarshal(bytes, &tests) | ||
if err != nil { | ||
panic(err) | ||
} | ||
for _, test := range tests { | ||
err = run(test) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
} |
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,27 @@ | ||
This document defines a canonical encoding algorithm for data structures which must be encoded in a known fashion for cross-chain verification in the IBC protocol. | ||
|
||
The encoding function maps a typed value into a byte array. | ||
|
||
### Primitive types | ||
|
||
If a value has a primitive type, it is encoded without tags. | ||
|
||
#### Numbers | ||
|
||
The protocol deals only with unsigned integers. | ||
|
||
`uint32` and `uint64` types are encoded as fixed-size little-endian, with no sign bit. | ||
|
||
#### Booleans | ||
|
||
Boolean values are encoded as single bits: `0x00` (false) and `0x01` (true). | ||
|
||
#### Bytes | ||
|
||
Byte arrays are encoded as-is with no length prefix or tag. | ||
|
||
### Structured types | ||
|
||
Structured types with fields are encoded as proto3 `message`s with the appropriate fields. | ||
|
||
Canonical `.proto` files are provided with the specification. |
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
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
Oops, something went wrong.