scaffold base auction & nextAuction types

This commit is contained in:
2022-08-25 18:49:35 -07:00
parent c829ab63fc
commit 6ff5b7fb7f
37 changed files with 4747 additions and 38 deletions

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
package cosmostest.cosmostest;
option go_package = "cosmos-test/x/cosmostest/types";
message Auction {
string index = 1;
string name = 2;
string description = 3;
string bids = 4;
string highestBid = 5;
}

View File

@@ -3,6 +3,8 @@ package cosmostest.cosmostest;
import "gogoproto/gogo.proto";
import "cosmostest/params.proto";
import "cosmostest/next_auction.proto";
import "cosmostest/auction.proto";
// this line is used by starport scaffolding # genesis/proto/import
option go_package = "cosmos-test/x/cosmostest/types";
@@ -10,5 +12,7 @@ option go_package = "cosmos-test/x/cosmostest/types";
// GenesisState defines the cosmostest module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
NextAuction nextAuction = 2;
repeated Auction auctionList = 3 [(gogoproto.nullable) = false];
// this line is used by starport scaffolding # genesis/proto/state
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
package cosmostest.cosmostest;
option go_package = "cosmos-test/x/cosmostest/types";
message NextAuction {
uint64 auctionId = 1;
}

View File

@@ -5,6 +5,8 @@ import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmostest/params.proto";
import "cosmostest/next_auction.proto";
import "cosmostest/auction.proto";
// this line is used by starport scaffolding # 1
option go_package = "cosmos-test/x/cosmostest/types";
@@ -15,7 +17,21 @@ service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cosmos-test/cosmostest/params";
}
// this line is used by starport scaffolding # 2
// Queries a NextAuction by index.
rpc NextAuction(QueryGetNextAuctionRequest) returns (QueryGetNextAuctionResponse) {
option (google.api.http).get = "/cosmos-test/cosmostest/next_auction";
}
// Queries a Auction by index.
rpc Auction(QueryGetAuctionRequest) returns (QueryGetAuctionResponse) {
option (google.api.http).get = "/cosmos-test/cosmostest/auction/{index}";
}
// Queries a list of Auction items.
rpc AuctionAll(QueryAllAuctionRequest) returns (QueryAllAuctionResponse) {
option (google.api.http).get = "/cosmos-test/cosmostest/auction";
}
// this line is used by starport scaffolding # 2
}
// QueryParamsRequest is request type for the Query/Params RPC method.
@@ -27,4 +43,27 @@ message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}
message QueryGetNextAuctionRequest {}
message QueryGetNextAuctionResponse {
NextAuction NextAuction = 1 [(gogoproto.nullable) = false];
}
message QueryGetAuctionRequest {
string index = 1;
}
message QueryGetAuctionResponse {
Auction auction = 1 [(gogoproto.nullable) = false];
}
message QueryAllAuctionRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
message QueryAllAuctionResponse {
repeated Auction auction = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// this line is used by starport scaffolding # 3