forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: prepare v0.46.11 release (cosmos#15259)
refactor refactor: move NFT from nft package to base package
- Loading branch information
1 parent
578c160
commit 614961a
Showing
43 changed files
with
1,339 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
proto/cosmos/nft/v1beta1/nft.proto → proto/cosmos/base/v1beta1/nft.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
Oops, something went wrong.