Skip to content

Commit

Permalink
fix: update proto to use Any (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
steezeburger authored May 20, 2024
1 parent 92c3f4e commit 160ab88
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# binary
go-sequencer-client-cli

# editors
.idea
10 changes: 8 additions & 2 deletions client/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down Expand Up @@ -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=
Expand Down

0 comments on commit 160ab88

Please sign in to comment.