-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add SignedSSVMessage * Add SSZ encoding * Test structures for SignedSSVMessage * Test utils and encoding test * Tests * Generate tests * Adapt message validation * Fix expected error; Bring back commented tests * Add comment on signature * Adjust ssz-max in SignedSSVMessage * Include RSA check in test * Generate JSONs
- Loading branch information
1 parent
a57c4bc
commit df58d97
Showing
22 changed files
with
608 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ package types | |
//go:generate go run github.com/ferranbt/fastssz/sszgen --path share.go --include ./operator.go,./messages.go,./signer.go,./domain_type.go | ||
|
||
// rm -f ./messages_encoding.go | ||
// go run github.com/ferranbt/fastssz/sszgen --path messages.go --exclude-objs ValidatorPK,MessageID,MsgType | ||
// go run github.com/ferranbt/fastssz/sszgen --path messages.go --include ./operator.go --exclude-objs ValidatorPK,MessageID,MsgType | ||
|
||
//go:generate rm -f ./beacon_types_encoding.go | ||
//go:generate go run github.com/ferranbt/fastssz/sszgen --path beacon_types.go --include $GOPATH/pkg/mod/github.com/attestantio/[email protected]/spec/phase0 --exclude-objs BeaconNetwork,BeaconRole | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
4 changes: 4 additions & 0 deletions
4
types/spectest/generate/state_comparison/signedssvmsg_EncodingTest/encoding.json
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,4 @@ | ||
{ | ||
"Name": "encoding", | ||
"Data": "AQAAAAAAAAAQAAAAEAEAAJ4RbcE7rt9XkrU0Gz+CmiUMg88fH/b8hB/oHOpFocKDdcWx5Q5xbAjiCHmq8rZtUHzrskOqPoZLsR9UY3LRAlJF9ban+DOnDnmloFi67e82d6EAfk6AYZ1ZNSZinWVYkRvP03J5gk3yRddHhPOWVDc4rwdxGYrTOLNZTTwyMcEiBqrPMrJ2SDwVpmw9RXGdEDNLrpVsuBRsCQKjr+7X1PBijkvmDfZO78uzyELIr/WUXWjgeBt1JK+4EVS2fn6DHY+t4E+kjKOrwsTw/+I6h7onqZa4kN7MM/10Cftu/NRTFhLiSwAxGgu6PcrDfDfmpaqFZgr1kdGrrGp8gDgB4CcBAAAAAAAAAAAAAwGOgAZlUagbMYJYcJ7a990fY81oag5NuLKbu3rP5lYIZ3r1pSfZRI7keDVIXgK1C8AAAAAARAAAAGwAAAC4Hs0i5KpVrepqk99cOgnRwFklXk1z+iLSuhz7kDMpGlKR3Fcf+DnJb/Hl+PSPwFcARY04jz4nVo8NdgTUduo7GOUm+WixamknKtLuJv5boz/EBTmKKiYlItZjiR4ztSABAAAAAAAAAAIAAAAAAAAADAAAAAAAAAAUAAAApHmwI9nyjrnM3TW7lg+1wmVTDf8Xiufkqbd/AX91nKWiEl5ya94M2SozMAlUlMjAB4Kif6iQfowarePazbjgYUaGxn4fYoMEYF14YeDtmAPGriFrSq5VqP+0nu0ZPL6nRiYR0sWSvfUhTxJP56Ummrc9RO/J5s4avjL4GWrlJt4BAAAAAAAAAA==" | ||
} |
12 changes: 12 additions & 0 deletions
12
...rate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg empty signature.json
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,12 @@ | ||
{ | ||
"Name": "empty signature", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "", | ||
"Data": "AQIDBA==" | ||
} | ||
], | ||
"ExpectedError": "Signature has length 0 in SignedSSVMessage", | ||
"RSAPublicKey": null | ||
} |
12 changes: 12 additions & 0 deletions
12
...est/generate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg no data.json
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,12 @@ | ||
{ | ||
"Name": "no data", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "AQIDBA==", | ||
"Data": "" | ||
} | ||
], | ||
"ExpectedError": "Data has length 0 in SignedSSVMessage", | ||
"RSAPublicKey": null | ||
} |
12 changes: 12 additions & 0 deletions
12
...ctest/generate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg valid.json
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,12 @@ | ||
{ | ||
"Name": "valid", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "asg313UXGPJPH1X4S5kFA0mP0EViK+/fiAudKPNWxmgSLAOOZa+zwhUCkd1lI6Mzxta8GsUwxxRekEclK7ipkjqeND6S9M5+EyyKOIXPkv3jaSHSJgy3czrM95vmr+ZEvlFeNVc1ueCVSc4tYn1WPE2Jgv5x2yGiI65gxOptXXUULfwxeTt+N+9nhKwYkHkosHYLEcSzVJ8+VSBLtQUQhZPAIhQBAQU5QO2xlHQaGz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VWZHBkMVBQdjc1VzdQUlVuTzV5NApkVTVwSEZPUENwbmZvRkJENjgwOTZHYW5EU2NTaDRpd3VkeGgyTGg0MmREVzI2eUNQYTQ3OUZXd0NFMk9JVEk1Cjl3SURBUUFCCi0tLS0tRU5EIFJTQSBQVUJMSUMgS0VZLS0tLS0K" | ||
} |
12 changes: 12 additions & 0 deletions
12
.../generate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg wrong data.json
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,12 @@ | ||
{ | ||
"Name": "wrong data", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "AQIDBA==", | ||
"Data": "AQIDBA==" | ||
} | ||
], | ||
"ExpectedError": "could not decode SSVMessage from data in SignedSSVMessage: incorrect size", | ||
"RSAPublicKey": null | ||
} |
Oops, something went wrong.