Skip to content

Added the marshal,unmarshal and size methods to make compatible with grpc#2660

Closed
vlasfama wants to merge 1 commit intotendermint:masterfrom
vlasfama:nagadev
Closed

Added the marshal,unmarshal and size methods to make compatible with grpc#2660
vlasfama wants to merge 1 commit intotendermint:masterfrom
vlasfama:nagadev

Conversation

@vlasfama
Copy link
Contributor

Added the marshal,unmarshal and size methods to make compatible with grpc protobuf
*Added the above function in blockmeta.go and block.go

@melekes
Copy link
Contributor

melekes commented Oct 21, 2018

types/block.go:743:15: bamino.Decode undefined (type *amino.Codec has no field or method Decode)
types/block_meta.go:21:5: bamino redeclared in this block
	previous declaration at types/block.go:727:5
types/block_meta.go:23:6: (*BlockMeta).Encode redeclared in this block
	previous declaration at types/block.go:769:6
types/block_meta.go:27:6: (*BlockMeta).Decode redeclared in this block
	previous declaration at types/block.go:773:6
types/block_meta.go:36:6: (*BlockMeta).Unmarshal redeclared in this block
	previous declaration at types/block.go:783:6
types/block_meta.go:40:6: (*BlockMeta).Marshal redeclared in this block
	previous declaration at types/block.go:787:6
types/block_meta.go:44:6: (*BlockMeta).MarshalTo redeclared in this block
	previous declaration at types/block.go:791:6
types/block_meta.go:52:6: (*BlockMeta).Size redeclared in this block
	previous declaration at types/block.go:799:6
types/block_meta.go:58:6: BlockMeta.MarshalJSON redeclared in this block
	previous declaration at types/block.go:805:6
types/block_meta.go:62:6: (*BlockMeta).UnmarshalJSON redeclared in this block
	previous declaration at types/block.go:809:6
types/block.go:743:15: too many errors

@melekes
Copy link
Contributor

melekes commented Oct 21, 2018

What is the issue you're trying to solve exactly? Tendermint is using https://github.com/tendermint/go-amino to encode/decode blocks and block parts.

@vlasfama
Copy link
Contributor Author

I am using the tendermint in our project. I have to get the blockmeta details and block details using grpc protobuf, when i create the protobuf its asking for Marshal, unmarshal and size methods for the blockmeta and block. which was not present in tendermint.

@melekes
Copy link
Contributor

melekes commented Oct 25, 2018

i create the protobuf its asking for Marshal, unmarshal and size

You can generate these methods automatically using https://github.com/gogo/protobuf or a similar library. Not sure we need these methods in our repo.

// For more information on gogo.proto, see:
// https://github.com/gogo/protobuf/blob/master/extensions.md
import "github.com/gogo/protobuf/gogoproto/gogo.proto";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.goproto_registration) = true;

// Generate tests
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.testgen_all) = true;

@vlasfama
Copy link
Contributor Author

move to #2705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants