Skip to content

Commit

Permalink
chore: prepare v0.46.11 release (cosmos#15259)
Browse files Browse the repository at this point in the history
refactor

refactor: move NFT from nft package to base package
  • Loading branch information
julienrbrt authored and gratis-dev committed May 17, 2023
1 parent 578c160 commit 614961a
Show file tree
Hide file tree
Showing 43 changed files with 1,339 additions and 778 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03

### Improvements

* (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md).
Expand All @@ -46,7 +48,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* [#15243](https://github.com/cosmos/cosmos-sdk/pull/15243) `LatestBlockResponse` & `BlockByHeightResponse` types' field `sdk_block` was incorrectly cast `proposer_address` bytes to validator operator address, now to consensus address.
* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in Go 1.19.

## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16

Expand Down
11 changes: 5 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Cosmos SDK v0.46.11 Release Notes

This release includes the migration to [CometBFT](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427). This migration should be not breaking.
This release includes the migration to [CometBFT v0.34.27](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427).
This migration should be not be breaking for chains.
From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application:

```go
// use cometbft
replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27
```

A more complete migration is happening in Cosmos SDK v0.47.0.

Additionally, the SDK sets its minimum version to Go 1.19.
This is not because the SDK uses new Go 1.19 functionalities, but because we recommend chains as well to upgrade to Go 1.19 because Go 1.18 is not supported anymore.
We recommend applications to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19.
Additionally, the SDK sets its minimum version to Go 1.19. This is not because the SDK uses new Go 1.19 functionalities, but to signal that we recommend chains to upgrade to Go 1.19 — Go 1.18 is not supported by the Go Team anymore.
Note, that SDK recommends chains to use the same Go version across all of their network.
We recommend, as well, chains to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19.

Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes.

Expand Down
1 change: 1 addition & 0 deletions proto/cosmos/auth/v1beta1/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ message BaseAccount {
google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"];
uint64 account_number = 3;
uint64 sequence = 4;
string property_id = 5;
}

// ModuleAccount defines an account for modules that holds coins on a pool.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package cosmos.nft.v1beta1;
package cosmos.base.v1beta1;

import "google/protobuf/any.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/nft";
option go_package = "github.com/cosmos/cosmos-sdk/types";

// Class defines the class of the nft type.
message Class {
Expand Down
20 changes: 20 additions & 0 deletions proto/cosmos/base/v1beta1/property.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";
package cosmos.base.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/base/v1beta1/nft.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types";
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = false;

// PropertyVector defines a set of user property balances embedded in a UserProperty NFT
message Property {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

cosmos.base.v1beta1.NFT nft = 1 [(gogoproto.embed) = true];
repeated cosmos.base.v1beta1.Coin balances = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "Coins"];
}
6 changes: 3 additions & 3 deletions proto/cosmos/nft/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
syntax = "proto3";
package cosmos.nft.v1beta1;

import "cosmos/nft/v1beta1/nft.proto";
import "cosmos/base/v1beta1/nft.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/nft";

// GenesisState defines the nft module's genesis state.
message GenesisState {
// class defines the class of the nft type.
repeated cosmos.nft.v1beta1.Class classes = 1;
repeated cosmos.base.v1beta1.Class classes = 1;
repeated Entry entries = 2;
}

Expand All @@ -18,5 +18,5 @@ message Entry {
string owner = 1;

// nfts is a group of nfts of the same owner
repeated cosmos.nft.v1beta1.NFT nfts = 2;
repeated cosmos.base.v1beta1.NFT nfts = 2;
}
10 changes: 5 additions & 5 deletions proto/cosmos/nft/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cosmos.nft.v1beta1;

import "cosmos/base/query/v1beta1/pagination.proto";
import "google/api/annotations.proto";
import "cosmos/nft/v1beta1/nft.proto";
import "cosmos/base/v1beta1/nft.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/nft";

Expand Down Expand Up @@ -87,7 +87,7 @@ message QueryNFTsRequest {

// QueryNFTsResponse is the response type for the Query/NFTs RPC methods
message QueryNFTsResponse {
repeated cosmos.nft.v1beta1.NFT nfts = 1;
repeated cosmos.base.v1beta1.NFT nfts = 1;
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

Expand All @@ -99,7 +99,7 @@ message QueryNFTRequest {

// QueryNFTResponse is the response type for the Query/NFT RPC method
message QueryNFTResponse {
cosmos.nft.v1beta1.NFT nft = 1;
cosmos.base.v1beta1.NFT nft = 1;
}

// QueryClassRequest is the request type for the Query/Class RPC method
Expand All @@ -109,7 +109,7 @@ message QueryClassRequest {

// QueryClassResponse is the response type for the Query/Class RPC method
message QueryClassResponse {
cosmos.nft.v1beta1.Class class = 1;
cosmos.base.v1beta1.Class class = 1;
}

// QueryClassesRequest is the request type for the Query/Classes RPC method
Expand All @@ -120,6 +120,6 @@ message QueryClassesRequest {

// QueryClassesResponse is the response type for the Query/Classes RPC method
message QueryClassesResponse {
repeated cosmos.nft.v1beta1.Class classes = 1;
repeated cosmos.base.v1beta1.Class classes = 1;
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
3 changes: 1 addition & 2 deletions scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ cd ..
# move proto files to the right places
cp -r github.com/cosmos/cosmos-sdk/* ./
rm -rf github.com

go mod tidy -compat=1.19
go mod tidy
1 change: 1 addition & 0 deletions snapshots/types/snapshot.pb.go

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

9 changes: 9 additions & 0 deletions testutil/testdata/unknonwnproto.pb.go

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

59 changes: 30 additions & 29 deletions x/nft/nft.pb.go → types/nft.pb.go

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

23 changes: 23 additions & 0 deletions types/property.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package types

import (
"strings"
)

// NewProperty returns a new property vector with a set of balances.
func NewProperty(nft *NFT, coins ...Coin) Property {
return Property{
NFT: nft,
Balances: coins,
}
}

// String provides a human-readable representation of a PropertyVector
func (v Property) String() string {
// Build the string with a string builder
var out strings.Builder
out.WriteString(v.NFT.String())
out.WriteString("balances:\n")
out.WriteString(v.Balances.String())
return out.String()
}
Loading

0 comments on commit 614961a

Please sign in to comment.