diff --git a/api/cerc/auction/v1/query.pulsar.go b/api/cerc/auction/v1/query.pulsar.go index 9eae3487..ff4466a4 100644 --- a/api/cerc/auction/v1/query.pulsar.go +++ b/api/cerc/auction/v1/query.pulsar.go @@ -7169,7 +7169,7 @@ type QueryAuctionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Auction ID + // Auction id Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -7243,7 +7243,7 @@ type QueryBidRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Auction ID + // Auction id AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` // Bidder address Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` @@ -7326,7 +7326,7 @@ type QueryBidsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Auction ID + // Auction id AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` } diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index 937a77a6..0ced8408 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -3371,7 +3371,7 @@ type MsgCommitBid struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Auction ID + // Auction id AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` // Commit Hash 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 unknownFields protoimpl.UnknownFields - // Auction ID + // Auction id AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` // Commit Hash Reveal string `protobuf:"bytes,2,opt,name=reveal,proto3" json:"reveal,omitempty"` diff --git a/go.mod b/go.mod index e29a85a6..e4386920 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( github.com/ipld/go-ipld-prime v0.21.0 github.com/spf13/cobra v1.8.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/grpc v1.60.1 google.golang.org/protobuf v1.32.0 @@ -169,7 +170,6 @@ require ( go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.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/sync v0.4.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/proto/cerc/auction/v1/query.proto b/proto/cerc/auction/v1/query.proto index 7d3575b7..cd88fc20 100644 --- a/proto/cerc/auction/v1/query.proto +++ b/proto/cerc/auction/v1/query.proto @@ -77,7 +77,7 @@ message QueryAuctionsResponse { // AuctionRequest is the format for querying a specific auction message QueryAuctionRequest { - // Auction ID + // Auction id string id = 1; } @@ -89,7 +89,7 @@ message QueryAuctionResponse { // BidRequest is the format for querying a specific bid in an auction message QueryBidRequest { - // Auction ID + // Auction id string auction_id = 1; // Bidder address string bidder = 2; @@ -103,7 +103,7 @@ message QueryBidResponse { // BidsRequest is the format for querying all bids in an auction message QueryBidsRequest { - // Auction ID + // Auction id string auction_id = 1; } diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index 33dc750e..ee6a7148 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -85,7 +85,7 @@ message MsgCommitBid { option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // Auction ID + // Auction id string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""]; // Commit Hash @@ -109,7 +109,7 @@ message MsgRevealBid { option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // Auction ID + // Auction id string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""]; // Commit Hash diff --git a/x/auction/events.go b/x/auction/events.go index af130741..b60264f5 100644 --- a/x/auction/events.go +++ b/x/auction/events.go @@ -11,7 +11,7 @@ const ( AttributeKeyRevealFee = "reveal-fee" AttributeKeyMinimumBid = "minimum-bid" AttributeKeySigner = "signer" - AttributeKeyAuctionID = "auction-id" + AttributeKeyAuctionId = "auction-id" AttributeKeyCommitHash = "commit-hash" AttributeKeyReveal = "reveal" diff --git a/x/auction/expected_keepers.go b/x/auction/expected_keepers.go index 2a7332d7..90f0caf9 100644 --- a/x/auction/expected_keepers.go +++ b/x/auction/expected_keepers.go @@ -8,11 +8,11 @@ import ( // Used to, for example, prevent deletion of a auction that's in use. type AuctionUsageKeeper interface { ModuleName() string - UsesAuction(ctx sdk.Context, auctionID string) bool + UsesAuction(ctx sdk.Context, auctionId string) bool - OnAuction(ctx sdk.Context, auctionID string) - OnAuctionBid(ctx sdk.Context, auctionID string, bidderAddress string) - OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) + OnAuction(ctx sdk.Context, auctionId string) + OnAuctionBid(ctx sdk.Context, auctionId string, bidderAddress string) + OnAuctionWinnerSelected(ctx sdk.Context, auctionId string) } // AuctionHooksWrapper is a wrapper for modules to inject AuctionUsageKeeper using depinject. diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 4774c1f3..5c9a2490 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -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.") } - chainID, err := wnsUtils.GetAttributeAsString(reveal, "chainId") - if err != nil || chainID != ctx.ChainID() { + chainId, err := wnsUtils.GetAttributeAsString(reveal, "chainId") + if err != nil || chainId != ctx.ChainID() { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal chainID.") } - auctionID, err := wnsUtils.GetAttributeAsString(reveal, "auctionId") - if err != nil || auctionID != msg.AuctionId { + auctionId, err := wnsUtils.GetAttributeAsString(reveal, "auctionId") + if err != nil || auctionId != msg.AuctionId { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal auction Id.") } diff --git a/x/auction/keeper/msg_server.go b/x/auction/keeper/msg_server.go index 45530f30..b2035a9e 100644 --- a/x/auction/keeper/msg_server.go +++ b/x/auction/keeper/msg_server.go @@ -67,7 +67,7 @@ func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid) ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( auctiontypes.EventTypeCommitBid, - sdk.NewAttribute(auctiontypes.AttributeKeyAuctionID, msg.AuctionId), + sdk.NewAttribute(auctiontypes.AttributeKeyAuctionId, msg.AuctionId), sdk.NewAttribute(auctiontypes.AttributeKeyCommitHash, msg.CommitHash), ), sdk.NewEvent( @@ -98,7 +98,7 @@ func (ms msgServer) RevealBid(c context.Context, msg *auctiontypes.MsgRevealBid) ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( auctiontypes.EventTypeRevealBid, - sdk.NewAttribute(auctiontypes.AttributeKeyAuctionID, msg.AuctionId), + sdk.NewAttribute(auctiontypes.AttributeKeyAuctionId, msg.AuctionId), sdk.NewAttribute(auctiontypes.AttributeKeyReveal, msg.Reveal), ), sdk.NewEvent( diff --git a/x/auction/msgs.go b/x/auction/msgs.go index 8e8aab2e..6aa4f798 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -25,9 +25,9 @@ func NewMsgCreateAuction(params Params, signer sdk.AccAddress) MsgCreateAuction } // 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{ - AuctionId: auctionID, + AuctionId: auctionId, CommitHash: commitHash, Signer: signer.String(), } diff --git a/x/auction/query.pb.go b/x/auction/query.pb.go index 2b05203a..d3603b9f 100644 --- a/x/auction/query.pb.go +++ b/x/auction/query.pb.go @@ -217,7 +217,7 @@ func (m *QueryAuctionsResponse) GetPagination() *query.PageRequest { // AuctionRequest is the format for querying a specific auction type QueryAuctionRequest struct { - // Auction ID + // Auction id 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 type QueryBidRequest struct { - // Auction ID + // Auction id AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` // Bidder address 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 type QueryBidsRequest struct { - // Auction ID + // Auction id AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` } diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index 4bf59e74..c16f93bb 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -125,7 +125,7 @@ var xxx_messageInfo_MsgCreateAuctionResponse proto.InternalMessageInfo // CommitBid defines the message to commit a bid 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"` // 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 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"` // Commit Hash Reveal string `protobuf:"bytes,2,opt,name=reveal,proto3" json:"reveal,omitempty" json:"reveal" yaml:"reveal"` diff --git a/x/auction/types.go b/x/auction/types.go index 93536356..4dc53e06 100644 --- a/x/auction/types.go +++ b/x/auction/types.go @@ -29,14 +29,14 @@ const ( BidStatusRevealed = "reveal" ) -// AuctionId simplifies generation of auction IDs. +// AuctionId simplifies generation of auction ids. type AuctionId struct { Address sdk.Address AccNum uint64 Sequence uint64 } -// Generate creates the auction ID. +// Generate creates the auction id. func (auctionId AuctionId) Generate() string { hasher := sha256.New() str := fmt.Sprintf("%s:%d:%d", auctionId.Address.String(), auctionId.AccNum, auctionId.Sequence) diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index 17bb57c9..0a2246ff 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -41,19 +41,19 @@ func (k RecordKeeper) ModuleName() string { 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") } -func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionID string) { +func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionId string) { 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") } -func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) { +func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string) { panic("unimplemented") }