Modify provider auction name

This commit is contained in:
IshaVenikar 2024-09-17 13:59:31 +05:30
parent d3b969ff17
commit 93c78b4464
7 changed files with 28 additions and 22 deletions

View File

@ -53,7 +53,7 @@ message Auction {
string id = 1; string id = 1;
// Auction's kind (vickrey | service_provider) // Auction's kind (vickrey | provider)
string kind = 2 [ string kind = 2 [
(gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\""
]; ];
@ -101,7 +101,7 @@ message Auction {
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
]; ];
// Addresses of the winners (one for vickrey and can be multiple for service_provider) // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions)
repeated string winner_addresses = 11; repeated string winner_addresses = 11;
// Winning bids, i.e., the best bids // Winning bids, i.e., the best bids

View File

@ -77,7 +77,7 @@ message MsgCreateAuction {
string signer = 6 string signer = 6
[ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ];
// Auction's kind (vickrey | service_provider) // Auction's kind (vickrey | provider)
string kind = 7 [ string kind = 7 [
(gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\""
]; ];

View File

@ -71,7 +71,6 @@ const createAuctionTests = () => {
commitFee, commitFee,
revealFee, revealFee,
minimumBid, minimumBid,
kind: 'vickrey',
signer: auctionCreatorAccount.address signer: auctionCreatorAccount.address
}, },
auctionCreatorAccount.privateKey, fee); auctionCreatorAccount.privateKey, fee);
@ -174,13 +173,12 @@ const createSPAuctionTests = () => {
amount: '100000000' amount: '100000000'
}; };
const auction = await registry.createServiceProviderAuction({ const auction = await registry.createProviderAuction({
commitsDuration, commitsDuration,
revealsDuration, revealsDuration,
commitFee, commitFee,
revealFee, revealFee,
signer: auctionCreatorAccount.address, signer: auctionCreatorAccount.address,
kind: 'service_provider',
maxPrice, maxPrice,
numProviders: 3 numProviders: 3
}, },

View File

@ -23,6 +23,7 @@ import {
import { import {
MessageMsgCommitBid, MessageMsgCommitBid,
MessageMsgRevealBid, MessageMsgRevealBid,
MsgCreateProviderAuction,
MsgCreateVickreyAuction MsgCreateVickreyAuction
} from './types/cerc/auction/message'; } from './types/cerc/auction/message';
import { MessageMsgSendCoins } from './types/cosmos/bank/message'; import { MessageMsgSendCoins } from './types/cosmos/bank/message';
@ -508,8 +509,7 @@ export class Registry {
commitFee, commitFee,
revealFee, revealFee,
minimumBid, minimumBid,
signer, signer
kind
}: MsgCreateVickreyAuction, }: MsgCreateVickreyAuction,
privateKey: string, privateKey: string,
fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise<MsgCreateAuctionResponse> { fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise<MsgCreateAuctionResponse> {
@ -524,7 +524,7 @@ export class Registry {
revealFee, revealFee,
minimumBid, minimumBid,
signer, signer,
kind, 'vickrey',
undefined, undefined,
0, 0,
fee, fee,
@ -532,16 +532,15 @@ export class Registry {
); );
} }
async createServiceProviderAuction ({ async createProviderAuction ({
commitsDuration, commitsDuration,
revealsDuration, revealsDuration,
commitFee, commitFee,
revealFee, revealFee,
signer, signer,
kind,
maxPrice, maxPrice,
numProviders numProviders
}: MsgCreateAuction, }: MsgCreateProviderAuction,
privateKey: string, privateKey: string,
fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise<MsgCreateAuctionResponse> { fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise<MsgCreateAuctionResponse> {
const account = new Account(Buffer.from(privateKey, 'hex')); const account = new Account(Buffer.from(privateKey, 'hex'));
@ -555,7 +554,7 @@ export class Registry {
revealFee, revealFee,
undefined, undefined,
signer, signer,
kind, 'provider',
maxPrice, maxPrice,
numProviders, numProviders,
fee, fee,

View File

@ -24,7 +24,7 @@ export interface Params {
/** Auction represents a sealed-bid on-chain auction */ /** Auction represents a sealed-bid on-chain auction */
export interface Auction { export interface Auction {
id: string; id: string;
/** Auction's kind (vickrey | service_provider) */ /** Auction's kind (vickrey | provider) */
kind: string; kind: string;
status: string; status: string;
/** Address of the creator of the auction */ /** Address of the creator of the auction */
@ -43,7 +43,7 @@ export interface Auction {
revealFee?: Coin; revealFee?: Coin;
/** Minimum acceptable bid amount for a valid commit */ /** Minimum acceptable bid amount for a valid commit */
minimumBid?: Coin; minimumBid?: Coin;
/** Addresses of the winners (one for vickrey and can be multiple for service_provider) */ /** Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) */
winnerAddresses: string[]; winnerAddresses: string[];
/** Winning bids, i.e., the best bids */ /** Winning bids, i.e., the best bids */
winningBids: Coin[]; winningBids: Coin[];

View File

@ -21,7 +21,7 @@ export interface MsgCreateAuction {
minimumBid?: Coin; minimumBid?: Coin;
/** Address of the signer */ /** Address of the signer */
signer: string; signer: string;
/** Auction's kind (vickrey | service_provider) */ /** Auction's kind (vickrey | provider) */
kind: string; kind: string;
/** Maximum acceptable bid amount (for service provider auctions) */ /** Maximum acceptable bid amount (for service provider auctions) */
maxPrice?: Coin; maxPrice?: Coin;

View File

@ -46,11 +46,20 @@ export interface MessageMsgRevealBid {
} }
export interface MsgCreateVickreyAuction { export interface MsgCreateVickreyAuction {
commitsDuration?: Duration; commitsDuration: Duration;
revealsDuration?: Duration; revealsDuration: Duration;
commitFee?: Coin; commitFee: Coin;
revealFee?: Coin; revealFee: Coin;
minimumBid?: Coin; minimumBid: Coin;
signer: string;
}
export interface MsgCreateProviderAuction {
commitsDuration: Duration;
revealsDuration: Duration;
commitFee: Coin;
revealFee: Coin;
maxPrice: Coin;
numProviders: number;
signer: string; signer: string;
kind: string;
} }