Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refine the code of crosschain and oracle modules #136

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proto/cosmos/crosschain/v1/crosschain.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crosschain/types";

// Params holds parameters for the cross chain module.
message Params {
// initial balance to mint for crosschain module when the chain starts
string init_module_balance = 1;
}
7 changes: 7 additions & 0 deletions proto/cosmos/crosschain/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,38 @@ message QueryParamsResponse {

// QueryCrossChainPackageRequest is the request type for the Query/CrossChainPackage RPC method.
message QueryCrossChainPackageRequest {
// channel id of the cross chain package
uint32 channel_id = 1;
// sequence of the cross chain package
uint64 sequence = 2;
}

// QueryCrossChainPackageResponse is the response type for the Query/CrossChainPackage RPC method.
message QueryCrossChainPackageResponse {
// content of the cross chain package
bytes package = 1;
}

// QuerySendSequenceRequest is the request type for the Query/SendSequence RPC method.
message QuerySendSequenceRequest {
// channel id of the cross chain package
uint32 channel_id = 1;
}

// QuerySendSequenceResponse is the response type for the Query/SendSequence RPC method.
message QuerySendSequenceResponse {
// sequence of the cross chain package
uint64 sequence = 1;
}

// QuerySendSequenceRequest is the request type for the Query/ReceiveSequence RPC method.
message QueryReceiveSequenceRequest {
// channel id of the cross chain package
uint32 channel_id = 1;
}

// QuerySendSequenceResponse is the response type for the Query/ReceiveSequence RPC method.
message QueryReceiveSequenceResponse {
// sequence of the cross chain package
uint64 sequence = 1;
}
8 changes: 8 additions & 0 deletions proto/cosmos/oracle/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@ message MsgClaim {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// sender address of the msg
string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// source chain id
uint32 src_chain_id = 2;
// destination chain id
uint32 dest_chain_id = 3;
// sequence of the oracle channel
uint64 sequence = 4;
// timestamp of the claim
uint64 timestamp = 5;
// payload of the claim
bytes payload = 6;
// bit map of the voted validators
repeated fixed64 vote_address_set = 7;
// bls signature of the claim
bytes agg_signature = 8;
}

Expand Down
1 change: 1 addition & 0 deletions x/crosschain/types/crosschain.pb.go

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

2 changes: 0 additions & 2 deletions x/crosschain/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const (
SequenceLength = 8

GovChannelId = sdk.ChannelID(9)

QueryParameters = "parameters"
)

var (
Expand Down
9 changes: 8 additions & 1 deletion x/crosschain/types/query.pb.go

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

10 changes: 5 additions & 5 deletions x/oracle/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/cosmos/cosmos-sdk/x/oracle/types"
)

func (suite *TestSuite) TestQueryParams() {
res, err := suite.queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{})
suite.Require().NoError(err)
suite.Require().NotNil(res)
suite.Require().Equal(suite.app.OracleKeeper.GetParams(suite.ctx), res.GetParams())
func (s *TestSuite) TestQueryParams() {
res, err := s.queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{})
s.Require().NoError(err)
s.Require().NotNil(res)
s.Require().Equal(s.app.OracleKeeper.GetParams(s.ctx), res.GetParams())
}
2 changes: 1 addition & 1 deletion x/oracle/types/oracle.pb.go

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

1 change: 0 additions & 1 deletion x/oracle/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const (

var (
KeyParamRelayerTimeout = []byte("RelayerTimeout")
KeyParamRelayerBackoffTime = []byte("RelayerBackoffTime")
KeyParamRelayerRewardShare = []byte("RelayerRewardShare")
KeyParamRelayerInterval = []byte("RelayerInterval")
)
Expand Down
22 changes: 15 additions & 7 deletions x/oracle/types/tx.pb.go

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