From 160ab88af402877da413272384f913c62e28a693 Mon Sep 17 00:00:00 2001 From: jesse snyder Date: Mon, 20 May 2024 15:02:16 -0600 Subject: [PATCH] fix: update proto to use Any (#12) --- .gitignore | 3 +++ client/signer.go | 10 ++++++++-- go.mod | 6 +++--- go.sum | 12 ++++++------ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 053025f..3c59d4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ # binary go-sequencer-client-cli + +# editors +.idea diff --git a/client/signer.go b/client/signer.go index 4da0a0a..79c684d 100644 --- a/client/signer.go +++ b/client/signer.go @@ -4,7 +4,8 @@ import ( "crypto/ed25519" "crypto/sha256" - proto "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" txproto "buf.build/gen/go/astria/protocol-apis/protocolbuffers/go/astria/protocol/transactions/v1alpha1" ) @@ -55,9 +56,14 @@ func (s *Signer) SignTransaction(tx *txproto.UnsignedTransaction) (*txproto.Sign return nil, err } + transaction := &anypb.Any{ + TypeUrl: "/astria.protocol.transactions.v1alpha1.UnsignedTransaction", + Value: bytes, + } + sig := ed25519.Sign(s.private, bytes) return &txproto.SignedTransaction{ - Transaction: tx, + Transaction: transaction, Signature: sig, PublicKey: s.private.Public().(ed25519.PublicKey), }, nil diff --git a/go.mod b/go.mod index dfc2175..831ebb0 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,11 @@ module github.com/astriaorg/go-sequencer-client go 1.20 require ( - buf.build/gen/go/astria/primitives/protocolbuffers/go v1.33.0-20240422195039-812e347acd6b.1 - buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.33.0-20240423053324-d198e0ffaebe.1 + buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.1-20240517150107-e54d335d6779.1 + buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.1-20240517150110-b4ffcca70a25.1 github.com/cometbft/cometbft v0.38.0 github.com/stretchr/testify v1.8.2 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.1 ) require ( diff --git a/go.sum b/go.sum index ea42f99..4517a6e 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ -buf.build/gen/go/astria/primitives/protocolbuffers/go v1.33.0-20240422195039-812e347acd6b.1 h1:ANEC8IuONtxy0go3DZqyXonzPGQ8kxDe3EOJNoqRol8= -buf.build/gen/go/astria/primitives/protocolbuffers/go v1.33.0-20240422195039-812e347acd6b.1/go.mod h1:1VK/IapDxiDL/a+arAHdzNuaTSeC6suYHRK8AxJQrUw= -buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.33.0-20240423053324-d198e0ffaebe.1 h1:nC7oacHpkcyANL9mv75ITcG4F4fNB2mgA/NOwnjD4kY= -buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.33.0-20240423053324-d198e0ffaebe.1/go.mod h1:uOEBh9AiqbMMJdh7i7AVIwO1BWMQKLAiz7gOPXrcFFE= +buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.1-20240517150107-e54d335d6779.1 h1:K81ohPiRa8KTd4sIqW/neYYTX/Xj1DBc/7e130VJU8M= +buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.1-20240517150107-e54d335d6779.1/go.mod h1:pkz/GfhAgZSnDxyZ5bmGUzk6iQNAvyW72pYPkqb7Pbk= +buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.1-20240517150110-b4ffcca70a25.1 h1:LV7H6fUo/Jnlxo/tDprTl+5PJ9ViHkV7tLVIQJ7ePg8= +buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.1-20240517150110-b4ffcca70a25.1/go.mod h1:J1rL2bYbqsPdg5AIK1u/4lL6L3Wi+L6d3Z4VksuYdd0= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -220,8 +220,8 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=