Fix auction funds release check
Some checks failed
Protobuf / lint (pull_request) Successful in 15s
Build / build (pull_request) Successful in 2m38s
Integration Tests / test-integration (pull_request) Successful in 2m23s
E2E Tests / test-e2e (pull_request) Successful in 4m2s
SDK Tests / sdk_tests_authority_auctions (pull_request) Failing after 5m21s
Unit Tests / test-unit (pull_request) Successful in 1m52s
SDK Tests / sdk_tests_nameservice_expiry (pull_request) Successful in 8m2s
SDK Tests / sdk_tests (pull_request) Failing after 10m6s
Some checks failed
Protobuf / lint (pull_request) Successful in 15s
Build / build (pull_request) Successful in 2m38s
Integration Tests / test-integration (pull_request) Successful in 2m23s
E2E Tests / test-e2e (pull_request) Successful in 4m2s
SDK Tests / sdk_tests_authority_auctions (pull_request) Failing after 5m21s
Unit Tests / test-unit (pull_request) Successful in 1m52s
SDK Tests / sdk_tests_nameservice_expiry (pull_request) Successful in 8m2s
SDK Tests / sdk_tests (pull_request) Failing after 10m6s
This commit is contained in:
parent
552db03227
commit
40ece271d0
@ -3563,8 +3563,10 @@ type Auction struct {
|
|||||||
MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"`
|
MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"`
|
||||||
// Number of desired providers (num of auction winners)
|
// Number of desired providers (num of auction winners)
|
||||||
// Only applicable in provider auctions
|
// Only applicable in provider auctions
|
||||||
NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"`
|
NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"`
|
||||||
FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty"`
|
// Whether funds have been released to providers
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Auction) Reset() {
|
func (x *Auction) Reset() {
|
||||||
|
@ -95,6 +95,8 @@ message Auction {
|
|||||||
// Only applicable in provider auctions
|
// Only applicable in provider auctions
|
||||||
int32 num_providers = 15;
|
int32 num_providers = 15;
|
||||||
|
|
||||||
|
// Whether funds have been released to providers
|
||||||
|
// Only applicable in provider auctions
|
||||||
bool funds_released = 16
|
bool funds_released = 16
|
||||||
[ (gogoproto.moretags) =
|
[ (gogoproto.moretags) =
|
||||||
"json:\"funds_released\" yaml:\"funds_released\"" ];
|
"json:\"funds_released\" yaml:\"funds_released\"" ];
|
||||||
|
@ -102,8 +102,10 @@ type Auction struct {
|
|||||||
MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"`
|
MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"`
|
||||||
// Number of desired providers (num of auction winners)
|
// Number of desired providers (num of auction winners)
|
||||||
// Only applicable in provider auctions
|
// Only applicable in provider auctions
|
||||||
NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"`
|
NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"`
|
||||||
FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty" json:"funds_released" yaml:"funds_released"`
|
// Whether funds have been released to providers
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty" json:"funds_released" yaml:"funds_released"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Auction) Reset() { *m = Auction{} }
|
func (m *Auction) Reset() { *m = Auction{} }
|
||||||
|
@ -931,14 +931,14 @@ func (k Keeper) ReleaseFunds(ctx sdk.Context, msg auctiontypes.MsgReleaseFunds)
|
|||||||
|
|
||||||
// Only the auction owner can release funds.
|
// Only the auction owner can release funds.
|
||||||
if msg.Signer != auction.OwnerAddress {
|
if msg.Signer != auction.OwnerAddress {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Auction owner mismatch.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Only auction owner can release funds.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if auction.Status != auctiontypes.AuctionStatusCompleted {
|
if auction.Status != auctiontypes.AuctionStatusCompleted {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if auction.Status == auctiontypes.AuctionStatusFundsReleased {
|
if auction.FundsReleased {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction funds already released.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction funds already released.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,9 +21,6 @@ const (
|
|||||||
|
|
||||||
// Auction has completed (winner selected).
|
// Auction has completed (winner selected).
|
||||||
AuctionStatusCompleted = "completed"
|
AuctionStatusCompleted = "completed"
|
||||||
|
|
||||||
// Auction has completed (winner selected).
|
|
||||||
AuctionStatusFundsReleased = "funds_released"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Bid status values.
|
// Bid status values.
|
||||||
|
Loading…
Reference in New Issue
Block a user