Skip to content

Commit

Permalink
Start integrating cosmos-proto (#5473)
Browse files Browse the repository at this point in the history
* Start integrating cosmos-proto

* Comment out tendermint stuff that won't build
  • Loading branch information
aaronc authored and alexanderbez committed Jan 3, 2020
1 parent 3f7f490 commit b7a67fe
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 327 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ proto-all: proto-gen proto-lint proto-check-breaking

proto-gen:
@go mod vendor
@go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos
@./scripts/protocgen.sh

proto-lint:
Expand Down
288 changes: 13 additions & 275 deletions crypto/codec.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions crypto/codec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ syntax = "proto3";
package cosmos_sdk.crypto.v1;

import "vendor/github.com/gogo/protobuf/gogoproto/gogo.proto";
import "vendor/github.com/regen-network/cosmos-proto/cosmos.proto";

option go_package = "github.com/cosmos/cosmos-sdk/crypto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;

// PublicKey defines a proto message with a single oneof field that represents a
// public key as a byte slice.
//
// NOTE: Private keys must still be amino-encoded for backwards compatiblity.
message PublicKey {
// pub defines an single supported public key type as a byte slice.
oneof pub {
bytes secp256k1 = 1;
bytes ed25519 = 2;
bytes multisig = 3;
}
// option (cosmos_proto.interface_type) = "github.com/tendermint/tendermint/crypto.PubKey";
// // pub defines an single supported public key type as a byte slice.
// oneof pub {
// // TODO make tendermint keys use []byte instead of [32]byte or generate the interface marshaling manually
// bytes secp256k1 = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/crypto/secp256k1.PubKeySecp256k1"];
// bytes ed25519 = 2 [(gogoproto.casttype) = "github.com/tendermint/tendermint/crypto/ed25519.PubKeyEd25519"];
// // TODO define multisig as a proto message in tendermint:
// bytes multisig = 3;
// }
}
Loading

0 comments on commit b7a67fe

Please sign in to comment.