Consistent variable naming
This commit is contained in:
parent
43afe3fc2a
commit
56930ffa35
@ -7169,7 +7169,7 @@ type QueryAuctionRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7243,7 +7243,7 @@ type QueryBidRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
||||||
// Bidder address
|
// Bidder address
|
||||||
Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"`
|
Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"`
|
||||||
@ -7326,7 +7326,7 @@ type QueryBidsRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3371,7 +3371,7 @@ type MsgCommitBid struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
||||||
// Commit Hash
|
// Commit Hash
|
||||||
CommitHash string `protobuf:"bytes,2,opt,name=commit_hash,json=commitHash,proto3" json:"commit_hash,omitempty"`
|
CommitHash string `protobuf:"bytes,2,opt,name=commit_hash,json=commitHash,proto3" json:"commit_hash,omitempty"`
|
||||||
@ -3463,7 +3463,7 @@ type MsgRevealBid struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
||||||
// Commit Hash
|
// Commit Hash
|
||||||
Reveal string `protobuf:"bytes,2,opt,name=reveal,proto3" json:"reveal,omitempty"`
|
Reveal string `protobuf:"bytes,2,opt,name=reveal,proto3" json:"reveal,omitempty"`
|
||||||
|
2
go.mod
2
go.mod
@ -37,6 +37,7 @@ require (
|
|||||||
github.com/ipld/go-ipld-prime v0.21.0
|
github.com/ipld/go-ipld-prime v0.21.0
|
||||||
github.com/spf13/cobra v1.8.0
|
github.com/spf13/cobra v1.8.0
|
||||||
github.com/spf13/viper v1.17.0
|
github.com/spf13/viper v1.17.0
|
||||||
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f
|
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f
|
||||||
google.golang.org/grpc v1.60.1
|
google.golang.org/grpc v1.60.1
|
||||||
google.golang.org/protobuf v1.32.0
|
google.golang.org/protobuf v1.32.0
|
||||||
@ -169,7 +170,6 @@ require (
|
|||||||
go.etcd.io/bbolt v1.3.8 // indirect
|
go.etcd.io/bbolt v1.3.8 // indirect
|
||||||
go.uber.org/multierr v1.10.0 // indirect
|
go.uber.org/multierr v1.10.0 // indirect
|
||||||
golang.org/x/crypto v0.16.0 // indirect
|
golang.org/x/crypto v0.16.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
|
||||||
golang.org/x/net v0.19.0 // indirect
|
golang.org/x/net v0.19.0 // indirect
|
||||||
golang.org/x/sync v0.4.0 // indirect
|
golang.org/x/sync v0.4.0 // indirect
|
||||||
golang.org/x/sys v0.15.0 // indirect
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
|
@ -77,7 +77,7 @@ message QueryAuctionsResponse {
|
|||||||
|
|
||||||
// AuctionRequest is the format for querying a specific auction
|
// AuctionRequest is the format for querying a specific auction
|
||||||
message QueryAuctionRequest {
|
message QueryAuctionRequest {
|
||||||
// Auction ID
|
// Auction id
|
||||||
string id = 1;
|
string id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ message QueryAuctionResponse {
|
|||||||
|
|
||||||
// BidRequest is the format for querying a specific bid in an auction
|
// BidRequest is the format for querying a specific bid in an auction
|
||||||
message QueryBidRequest {
|
message QueryBidRequest {
|
||||||
// Auction ID
|
// Auction id
|
||||||
string auction_id = 1;
|
string auction_id = 1;
|
||||||
// Bidder address
|
// Bidder address
|
||||||
string bidder = 2;
|
string bidder = 2;
|
||||||
@ -103,7 +103,7 @@ message QueryBidResponse {
|
|||||||
|
|
||||||
// BidsRequest is the format for querying all bids in an auction
|
// BidsRequest is the format for querying all bids in an auction
|
||||||
message QueryBidsRequest {
|
message QueryBidsRequest {
|
||||||
// Auction ID
|
// Auction id
|
||||||
string auction_id = 1;
|
string auction_id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ message MsgCommitBid {
|
|||||||
option (gogoproto.goproto_getters) = false;
|
option (gogoproto.goproto_getters) = false;
|
||||||
option (cosmos.msg.v1.signer) = "signer";
|
option (cosmos.msg.v1.signer) = "signer";
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
||||||
|
|
||||||
// Commit Hash
|
// Commit Hash
|
||||||
@ -109,7 +109,7 @@ message MsgRevealBid {
|
|||||||
option (gogoproto.goproto_getters) = false;
|
option (gogoproto.goproto_getters) = false;
|
||||||
option (cosmos.msg.v1.signer) = "signer";
|
option (cosmos.msg.v1.signer) = "signer";
|
||||||
|
|
||||||
// Auction ID
|
// Auction id
|
||||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
||||||
|
|
||||||
// Commit Hash
|
// Commit Hash
|
||||||
|
@ -11,7 +11,7 @@ const (
|
|||||||
AttributeKeyRevealFee = "reveal-fee"
|
AttributeKeyRevealFee = "reveal-fee"
|
||||||
AttributeKeyMinimumBid = "minimum-bid"
|
AttributeKeyMinimumBid = "minimum-bid"
|
||||||
AttributeKeySigner = "signer"
|
AttributeKeySigner = "signer"
|
||||||
AttributeKeyAuctionID = "auction-id"
|
AttributeKeyAuctionId = "auction-id"
|
||||||
AttributeKeyCommitHash = "commit-hash"
|
AttributeKeyCommitHash = "commit-hash"
|
||||||
AttributeKeyReveal = "reveal"
|
AttributeKeyReveal = "reveal"
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ import (
|
|||||||
// Used to, for example, prevent deletion of a auction that's in use.
|
// Used to, for example, prevent deletion of a auction that's in use.
|
||||||
type AuctionUsageKeeper interface {
|
type AuctionUsageKeeper interface {
|
||||||
ModuleName() string
|
ModuleName() string
|
||||||
UsesAuction(ctx sdk.Context, auctionID string) bool
|
UsesAuction(ctx sdk.Context, auctionId string) bool
|
||||||
|
|
||||||
OnAuction(ctx sdk.Context, auctionID string)
|
OnAuction(ctx sdk.Context, auctionId string)
|
||||||
OnAuctionBid(ctx sdk.Context, auctionID string, bidderAddress string)
|
OnAuctionBid(ctx sdk.Context, auctionId string, bidderAddress string)
|
||||||
OnAuctionWinnerSelected(ctx sdk.Context, auctionID string)
|
OnAuctionWinnerSelected(ctx sdk.Context, auctionId string)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuctionHooksWrapper is a wrapper for modules to inject AuctionUsageKeeper using depinject.
|
// AuctionHooksWrapper is a wrapper for modules to inject AuctionUsageKeeper using depinject.
|
||||||
|
@ -473,13 +473,13 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct
|
|||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Reveal JSON unmarshal error.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Reveal JSON unmarshal error.")
|
||||||
}
|
}
|
||||||
|
|
||||||
chainID, err := wnsUtils.GetAttributeAsString(reveal, "chainId")
|
chainId, err := wnsUtils.GetAttributeAsString(reveal, "chainId")
|
||||||
if err != nil || chainID != ctx.ChainID() {
|
if err != nil || chainId != ctx.ChainID() {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal chainID.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal chainID.")
|
||||||
}
|
}
|
||||||
|
|
||||||
auctionID, err := wnsUtils.GetAttributeAsString(reveal, "auctionId")
|
auctionId, err := wnsUtils.GetAttributeAsString(reveal, "auctionId")
|
||||||
if err != nil || auctionID != msg.AuctionId {
|
if err != nil || auctionId != msg.AuctionId {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal auction Id.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal auction Id.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid)
|
|||||||
ctx.EventManager().EmitEvents(sdk.Events{
|
ctx.EventManager().EmitEvents(sdk.Events{
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
auctiontypes.EventTypeCommitBid,
|
auctiontypes.EventTypeCommitBid,
|
||||||
sdk.NewAttribute(auctiontypes.AttributeKeyAuctionID, msg.AuctionId),
|
sdk.NewAttribute(auctiontypes.AttributeKeyAuctionId, msg.AuctionId),
|
||||||
sdk.NewAttribute(auctiontypes.AttributeKeyCommitHash, msg.CommitHash),
|
sdk.NewAttribute(auctiontypes.AttributeKeyCommitHash, msg.CommitHash),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
@ -98,7 +98,7 @@ func (ms msgServer) RevealBid(c context.Context, msg *auctiontypes.MsgRevealBid)
|
|||||||
ctx.EventManager().EmitEvents(sdk.Events{
|
ctx.EventManager().EmitEvents(sdk.Events{
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
auctiontypes.EventTypeRevealBid,
|
auctiontypes.EventTypeRevealBid,
|
||||||
sdk.NewAttribute(auctiontypes.AttributeKeyAuctionID, msg.AuctionId),
|
sdk.NewAttribute(auctiontypes.AttributeKeyAuctionId, msg.AuctionId),
|
||||||
sdk.NewAttribute(auctiontypes.AttributeKeyReveal, msg.Reveal),
|
sdk.NewAttribute(auctiontypes.AttributeKeyReveal, msg.Reveal),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
|
@ -25,9 +25,9 @@ func NewMsgCreateAuction(params Params, signer sdk.AccAddress) MsgCreateAuction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgCommitBid is the constructor function for MsgCommitBid.
|
// NewMsgCommitBid is the constructor function for MsgCommitBid.
|
||||||
func NewMsgCommitBid(auctionID string, commitHash string, signer sdk.AccAddress) MsgCommitBid {
|
func NewMsgCommitBid(auctionId string, commitHash string, signer sdk.AccAddress) MsgCommitBid {
|
||||||
return MsgCommitBid{
|
return MsgCommitBid{
|
||||||
AuctionId: auctionID,
|
AuctionId: auctionId,
|
||||||
CommitHash: commitHash,
|
CommitHash: commitHash,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ func (m *QueryAuctionsResponse) GetPagination() *query.PageRequest {
|
|||||||
|
|
||||||
// AuctionRequest is the format for querying a specific auction
|
// AuctionRequest is the format for querying a specific auction
|
||||||
type QueryAuctionRequest struct {
|
type QueryAuctionRequest struct {
|
||||||
// Auction ID
|
// Auction id
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ func (m *QueryAuctionResponse) GetAuction() *Auction {
|
|||||||
|
|
||||||
// BidRequest is the format for querying a specific bid in an auction
|
// BidRequest is the format for querying a specific bid in an auction
|
||||||
type QueryBidRequest struct {
|
type QueryBidRequest struct {
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
||||||
// Bidder address
|
// Bidder address
|
||||||
Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"`
|
Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"`
|
||||||
@ -410,7 +410,7 @@ func (m *QueryBidResponse) GetBid() *Bid {
|
|||||||
|
|
||||||
// BidsRequest is the format for querying all bids in an auction
|
// BidsRequest is the format for querying all bids in an auction
|
||||||
type QueryBidsRequest struct {
|
type QueryBidsRequest struct {
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ var xxx_messageInfo_MsgCreateAuctionResponse proto.InternalMessageInfo
|
|||||||
|
|
||||||
// CommitBid defines the message to commit a bid
|
// CommitBid defines the message to commit a bid
|
||||||
type MsgCommitBid struct {
|
type MsgCommitBid struct {
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auction_id" yaml:"auction_id"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auction_id" yaml:"auction_id"`
|
||||||
// Commit Hash
|
// Commit Hash
|
||||||
CommitHash string `protobuf:"bytes,2,opt,name=commit_hash,json=commitHash,proto3" json:"commit_hash,omitempty" json:"commit_hash" yaml:"commit_hash"`
|
CommitHash string `protobuf:"bytes,2,opt,name=commit_hash,json=commitHash,proto3" json:"commit_hash,omitempty" json:"commit_hash" yaml:"commit_hash"`
|
||||||
@ -207,7 +207,7 @@ var xxx_messageInfo_MsgCommitBidResponse proto.InternalMessageInfo
|
|||||||
|
|
||||||
// RevealBid defines the message to reveal a bid
|
// RevealBid defines the message to reveal a bid
|
||||||
type MsgRevealBid struct {
|
type MsgRevealBid struct {
|
||||||
// Auction ID
|
// Auction id
|
||||||
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auction_id" yaml:"auction_id"`
|
AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auction_id" yaml:"auction_id"`
|
||||||
// Commit Hash
|
// Commit Hash
|
||||||
Reveal string `protobuf:"bytes,2,opt,name=reveal,proto3" json:"reveal,omitempty" json:"reveal" yaml:"reveal"`
|
Reveal string `protobuf:"bytes,2,opt,name=reveal,proto3" json:"reveal,omitempty" json:"reveal" yaml:"reveal"`
|
||||||
|
@ -29,14 +29,14 @@ const (
|
|||||||
BidStatusRevealed = "reveal"
|
BidStatusRevealed = "reveal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuctionId simplifies generation of auction IDs.
|
// AuctionId simplifies generation of auction ids.
|
||||||
type AuctionId struct {
|
type AuctionId struct {
|
||||||
Address sdk.Address
|
Address sdk.Address
|
||||||
AccNum uint64
|
AccNum uint64
|
||||||
Sequence uint64
|
Sequence uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate creates the auction ID.
|
// Generate creates the auction id.
|
||||||
func (auctionId AuctionId) Generate() string {
|
func (auctionId AuctionId) Generate() string {
|
||||||
hasher := sha256.New()
|
hasher := sha256.New()
|
||||||
str := fmt.Sprintf("%s:%d:%d", auctionId.Address.String(), auctionId.AccNum, auctionId.Sequence)
|
str := fmt.Sprintf("%s:%d:%d", auctionId.Address.String(), auctionId.AccNum, auctionId.Sequence)
|
||||||
|
@ -41,19 +41,19 @@ func (k RecordKeeper) ModuleName() string {
|
|||||||
return registrytypes.ModuleName
|
return registrytypes.ModuleName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k RecordKeeper) UsesAuction(ctx sdk.Context, auctionID string) bool {
|
func (k RecordKeeper) UsesAuction(ctx sdk.Context, auctionId string) bool {
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionID string) {
|
func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionId string) {
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k RecordKeeper) OnAuctionBid(ctx sdk.Context, auctionID string, bidderAddress string) {
|
func (k RecordKeeper) OnAuctionBid(ctx sdk.Context, auctionId string, bidderAddress string) {
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) {
|
func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string) {
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user