Skip to content

Commit 2bc79dc

Browse files
e-asphyxEugene Zagidullinjevonearth
authored
Gotez v2.3.19 (#715)
* Gotez v2.3.16 fixes run_operation helper script input encoding * Missed type alias * Gotez v2.3.18 adds signature canonization back * Only list operations allowed under generic request; Gotez-v2.3.19 --------- Co-authored-by: Eugene Zagidullin <eugene@ecadlabs.com> Co-authored-by: Jev Björsell <jev@ecadlabs.com>
1 parent 53e99d9 commit 2bc79dc

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

cmd/commands/list_ops.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func NewListOps(c *Context) *cobra.Command {
4444
Use: "list-ops",
4545
Short: "Print possible operation types inside the `generic` request",
4646
RunE: func(cmd *cobra.Command, args []string) error {
47-
ops := proto.ListOperations()
47+
ops := proto.ListGenericOperations()
4848
ops = append(ops, proto.ListPseudoOperations()...)
4949
slices.Sort(ops)
5050
return listOpsTpl.Execute(os.Stdout, ops)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/certusone/yubihsm-go v0.3.0
1717
github.com/ecadlabs/go-pkcs11 v0.3.0
1818
github.com/ecadlabs/goblst v1.1.0
19-
github.com/ecadlabs/gotez/v2 v2.3.18
19+
github.com/ecadlabs/gotez/v2 v2.3.19
2020
github.com/fxamacker/cbor/v2 v2.9.0
2121
github.com/go-playground/validator/v10 v10.30.1
2222
github.com/google/tink/go v1.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ github.com/ecadlabs/go-pkcs11 v0.3.0 h1:AsLURdNoZn0YocumJFloWXIlx1f2SDw4eTx4nPMa
7373
github.com/ecadlabs/go-pkcs11 v0.3.0/go.mod h1:PwAVBY0muwp6quQFmSDcB5Ekl4TjGG7cEQQwY9KpNVc=
7474
github.com/ecadlabs/goblst v1.1.0 h1:U0JzRxIbtv1OsefUqfXNJ1HLzPMSaHY8aOeIQggUe9U=
7575
github.com/ecadlabs/goblst v1.1.0/go.mod h1:s67gqaOol9o6fguh+evH75X5uQniOhv1HG/EU8xPLPY=
76-
github.com/ecadlabs/gotez/v2 v2.3.18 h1:pYgm6CBF5FG59uja6fZ2xa09lV5Jp9n6CcJVwJVFxyQ=
77-
github.com/ecadlabs/gotez/v2 v2.3.18/go.mod h1:tgp2C5U1fgdniQwl//Jp5ejSB2suySXixD+a4GbK2s8=
76+
github.com/ecadlabs/gotez/v2 v2.3.19 h1:ZydIDEz94aGxLaX3OLWuE9j4K1sd5epKXSVJvELncgo=
77+
github.com/ecadlabs/gotez/v2 v2.3.19/go.mod h1:tgp2C5U1fgdniQwl//Jp5ejSB2suySXixD+a4GbK2s8=
7878
github.com/ecadlabs/pretty v0.0.0-20230412124801-f948fc689a04 h1:7WdblGykGxtGGtchW4kzTaJJO8Fm+JKhLzhttOOWr9k=
7979
github.com/ecadlabs/pretty v0.0.0-20230412124801-f948fc689a04/go.mod h1:VApUlocsLMpp4hUXHxTTIlosebnwo0BM6e1hy78qTPM=
8080
github.com/enceve/crypto v0.0.0-20160707101852-34d48bb93815 h1:D22EM5TeYZJp43hGDx6dUng8mvtyYbB9BnE3+BmJR1Q=

pkg/signatory/request/request_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestSignRequest(t *testing.T) {
121121
0xeb, 0xa4, 0xcb, 0xf2, 0x92, 0x78, 0xc2, 0xc1, 0x4, 0x47, 0xa6, 0x84, 0xe3, 0xaa,
122122
0x14, 0x36, 0x85,
123123
},
124-
Contents: []latest.OperationContents{
124+
Contents: []latest.GenericOperationSignRequestOperationContents{
125125
&latest.Transaction{
126126
ManagerOperation: latest.ManagerOperation{
127127
Source: &tz.Ed25519PublicKeyHash{
@@ -165,7 +165,7 @@ func TestSignRequest(t *testing.T) {
165165
0xeb, 0xa4, 0xcb, 0xf2, 0x92, 0x78, 0xc2, 0xc1, 0x4, 0x47, 0xa6, 0x84, 0xe3, 0xaa,
166166
0x14, 0x36, 0x85,
167167
},
168-
Contents: []latest.OperationContents{
168+
Contents: []latest.GenericOperationSignRequestOperationContents{
169169
&latest.Transaction{
170170
ManagerOperation: latest.ManagerOperation{
171171
Source: &tz.Ed25519PublicKeyHash{

pkg/signatory/signatory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ func checkRequestKind(allowedKinds []string) error {
698698
}
699699

700700
func checkOperationKind(allowedKinds []string) error {
701-
avilKinds := append(proto.ListOperations(), proto.ListPseudoOperations()...)
701+
avilKinds := append(proto.ListGenericOperations(), proto.ListPseudoOperations()...)
702702
for _, kind := range allowedKinds {
703703
if !slices.Contains(avilKinds, kind) {
704704
return fmt.Errorf("invalid operation kind `%s` in `allow.generic` list", kind)

pkg/signatory/signatory_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func TestPolicy(t *testing.T) {
323323
title: "Stake allowed",
324324
req: &latest.GenericOperationSignRequest{
325325
Branch: &tz.BlockHash{},
326-
Contents: []latest.OperationContents{
326+
Contents: []latest.GenericOperationSignRequestOperationContents{
327327
&latest.Transaction{
328328
ManagerOperation: latest.ManagerOperation{
329329
Source: &tz.Ed25519PublicKeyHash{1, 2, 3},
@@ -351,7 +351,7 @@ func TestPolicy(t *testing.T) {
351351
title: "ballot allowed",
352352
req: &latest.GenericOperationSignRequest{
353353
Branch: &tz.BlockHash{},
354-
Contents: []latest.OperationContents{
354+
Contents: []latest.GenericOperationSignRequestOperationContents{
355355
&latest.Ballot{
356356
Source: &tz.Ed25519PublicKeyHash{1, 2, 3},
357357
Period: 0,
@@ -370,7 +370,7 @@ func TestPolicy(t *testing.T) {
370370
title: "ballot nay allowed",
371371
req: &latest.GenericOperationSignRequest{
372372
Branch: &tz.BlockHash{},
373-
Contents: []latest.OperationContents{
373+
Contents: []latest.GenericOperationSignRequestOperationContents{
374374
&latest.Ballot{
375375
Source: &tz.Ed25519PublicKeyHash{1, 2, 3},
376376
Period: 0,
@@ -389,7 +389,7 @@ func TestPolicy(t *testing.T) {
389389
title: "ballot yay not allowed",
390390
req: &latest.GenericOperationSignRequest{
391391
Branch: &tz.BlockHash{},
392-
Contents: []latest.OperationContents{
392+
Contents: []latest.GenericOperationSignRequestOperationContents{
393393
&latest.Ballot{
394394
Source: &tz.Ed25519PublicKeyHash{1, 2, 3},
395395
Period: 0,

0 commit comments

Comments
 (0)