Skip to content

Commit

Permalink
Problem: protobuf message urls should not change (#1044)
Browse files Browse the repository at this point in the history
Solution:
- revert the package name change introduced in #1023.
- don't remember why we have to change it there, but it seems not
  nesserary, revert it to keep it backward compatible.

Update CHANGELOG.md

Signed-off-by: yihuang <[email protected]>

match protobuf package name with directory structure

fix test
  • Loading branch information
yihuang authored Jul 9, 2024
1 parent b6afee3 commit eca9a2c
Show file tree
Hide file tree
Showing 41 changed files with 711 additions and 683 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## UNRELEASED

- [#1023](https://github.com/crypto-org-chain/chain-main/pull/1023) Integrate sdk 0.47
- [#1044](https://github.com/crypto-org-chain/chain-main/pull/1044) Revert the protobuf package name changes introduced in #1023.

*Dec 6, 2023*

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/test_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_create_nft_token(cluster):
uri = "testuri"
rsp = cluster.create_nft_token(singer1_addr, singer2_addr, denomid, tokenid, uri)
ev = find_log_event_attrs(rsp["logs"], "message")
assert ev["action"] == "/nft.v1.MsgMintNFT", ev
assert ev["action"] == "/chainmain.nft.v1.MsgMintNFT", ev


def test_query_nft_token(cluster):
Expand All @@ -67,7 +67,7 @@ def test_transfer_nft_token(cluster):
singer2_addr = cluster.address("signer2")
rsp = cluster.transfer_nft_token(singer2_addr, singer1_addr, denomid, tokenid)
ev = find_log_event_attrs(rsp["logs"], "message")
assert ev["action"] == "/nft.v1.MsgTransferNFT", ev
assert ev["action"] == "/chainmain.nft.v1.MsgTransferNFT", ev


def test_query_nft_token_again(cluster):
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_nft_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_nft_transfer(cluster):
if rsp["code"] == 0:
rsp = cli_src.event_query_tx_for(rsp["txhash"])
ev = find_log_event_attrs(rsp["logs"], "message")
assert ev["action"] == "/nft.v1.MsgMintNFT", ev
assert ev["action"] == "/chainmain.nft.v1.MsgMintNFT", ev

# nft transfer that's supposed to fail, exceeds max receiver length
rsp = json.loads(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package chainmain.v1;
package chainmain.chainmain.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/chainmain/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";
package icaauth.v1;
package chainmain.icaauth.v1;

import "gogoproto/gogo.proto";
import "icaauth/v1/params.proto";
import "chainmain/icaauth/v1/params.proto";

option go_package = "github.com/crypto-org-chain/chain-main/x/icaauth/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package icaauth.v1;
package chainmain.icaauth.v1;

import "google/protobuf/duration.proto";
import "gogoproto/gogo.proto";
Expand All @@ -17,4 +17,4 @@ message Params {
(gogoproto.stdduration) = true,
(gogoproto.nullable) = false
];
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package icaauth.v1;
package chainmain.icaauth.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "icaauth/v1/params.proto";
import "chainmain/icaauth/v1/params.proto";

option go_package = "github.com/crypto-org-chain/chain-main/x/icaauth/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package icaauth.v1;
package chainmain.icaauth.v1;

import "cosmos_proto/cosmos.proto";
import "google/protobuf/any.proto";
Expand Down Expand Up @@ -48,4 +48,4 @@ message MsgSubmitTx {
}

// MsgSubmitTxResponse defines the response message for MsgSubmitTx
message MsgSubmitTxResponse {}
message MsgSubmitTxResponse {}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) 2016-2021 Shanghai Bianjie AI Technology Inc. (licensed under the Apache License, Version 2.0)
// Modifications Copyright (c) 2021-present Crypto.org (licensed under the Apache License, Version 2.0)
syntax = "proto3";
package nft.v1;
package chainmain.nft.v1;

import "gogoproto/gogo.proto";
import "nft/v1/nft.proto";
import "chainmain/nft/v1/nft.proto";

option go_package = "github.com/crypto-org-chain/chain-main/x/nft/types";

Expand Down
4 changes: 2 additions & 2 deletions proto/nft/v1/nft.proto → proto/chainmain/nft/v1/nft.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2016-2021 Shanghai Bianjie AI Technology Inc. (licensed under the Apache License, Version 2.0)
// Modifications Copyright (c) 2021-present Crypto.org (licensed under the Apache License, Version 2.0)
syntax = "proto3";
package nft.v1;
package chainmain.nft.v1;

import "gogoproto/gogo.proto";

Expand Down Expand Up @@ -54,4 +54,4 @@ message Collection {

Denom denom = 1 [(gogoproto.nullable) = false];
repeated BaseNFT nfts = 2 [(gogoproto.customname) = "NFTs", (gogoproto.nullable) = false];
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) 2016-2021 Shanghai Bianjie AI Technology Inc. (licensed under the Apache License, Version 2.0)
// Modifications Copyright (c) 2021-present Crypto.org (licensed under the Apache License, Version 2.0)
syntax = "proto3";
package nft.v1;
package chainmain.nft.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "nft/v1/nft.proto";
import "chainmain/nft/v1/nft.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

option go_package = "github.com/crypto-org-chain/chain-main/x/nft/types";
Expand Down Expand Up @@ -128,4 +128,4 @@ message QueryNFTRequest {
// QueryNFTResponse is the response type for the Query/NFT RPC method
message QueryNFTResponse {
BaseNFT nft = 1 [(gogoproto.customname) = "NFT"];
}
}
4 changes: 2 additions & 2 deletions proto/nft/v1/tx.proto → proto/chainmain/nft/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2016-2021 Shanghai Bianjie AI Technology Inc. (licensed under the Apache License, Version 2.0)
// Modifications Copyright (c) 2021-present Crypto.org (licensed under the Apache License, Version 2.0)
syntax = "proto3";
package nft.v1;
package chainmain.nft.v1;

import "gogoproto/gogo.proto";

Expand Down Expand Up @@ -94,4 +94,4 @@ message MsgBurnNFT {
}

// MsgBurnNFTResponse defines the Msg/BurnNFT response type.
message MsgBurnNFTResponse {}
message MsgBurnNFTResponse {}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package nft_transfer.v1;
package chainmain.nft_transfer.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/nft-transfer/types";

import "nft_transfer/v1/trace.proto";
import "chainmain/nft_transfer/v1/trace.proto";
import "gogoproto/gogo.proto";

// GenesisState defines the ibc-nft-transfer genesis state
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package nft_transfer.v1;
package chainmain.nft_transfer.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/nft-transfer/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";
package nft_transfer.v1;
package chainmain.nft_transfer.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/nft-transfer/types";

import "gogoproto/gogo.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "nft_transfer/v1/trace.proto";
import "chainmain/nft_transfer/v1/trace.proto";
import "google/api/annotations.proto";

// Query provides defines the gRPC querier service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package nft_transfer.v1;
package chainmain.nft_transfer.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/nft-transfer/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package nft_transfer.v1;
package chainmain.nft_transfer.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/nft-transfer/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package supply.v1;
package chainmain.supply.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/supply/types";

// VestingAccounts stored in keeper
message VestingAccounts {
// addresses defines addresses of all the vesting accounts at genesis
repeated string addresses = 1;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package supply.v1;
package chainmain.supply.v1;

option go_package = "github.com/crypto-org-chain/chain-main/x/supply/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package supply.v1;
package chainmain.supply.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
Expand Down Expand Up @@ -32,4 +32,4 @@ message SupplyResponse {
// supply is the supply of the coins
repeated cosmos.base.v1beta1.Coin supply = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
}
33 changes: 18 additions & 15 deletions x/chainmain/types/genesis.pb.go

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

41 changes: 22 additions & 19 deletions x/icaauth/types/genesis.pb.go

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

Loading

0 comments on commit eca9a2c

Please sign in to comment.