Skip to content

Commit

Permalink
feat: cosmwasm lifecycle execution n# blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Oct 23, 2023
1 parent a253c6f commit aa7b8f4
Show file tree
Hide file tree
Showing 21 changed files with 1,560 additions and 557 deletions.
109 changes: 105 additions & 4 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34923,10 +34923,10 @@ paths:
format: int64
tags:
- Query
/emidev98/cosmwasm-lifecycle/cosmwasmlifecycle/params:
/cosmwasmlifecycle/params:
get:
summary: Parameters queries the parameters of the module.
operationId: CosmwasmlifecycleCosmwasmlifecycleParams
operationId: Emidev98CosmwasmlifecycleParams
responses:
'200':
description: A successful response.
Expand All @@ -34936,6 +34936,32 @@ paths:
params:
description: params holds all the parameters of this module.
type: object
properties:
is_enabled:
type: boolean
title: |-
Enable or disable executions
at the begin and end of the block
min_deposit:
description: >-
Minimum deposit to enable contract execution at begin
block and/or end block

This deposit will be burned if the contract execution
reaches the max strikes.
type: object
properties:
denom:
type: string
amount:
type: string
strikes_to_disable_execution:
type: string
format: int64
description: |-
Amount of strikes that the contract can hold before being
disabled from end and beging block executions.
When this happens the min_desposit will also be burned.
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
Expand Down Expand Up @@ -70567,15 +70593,90 @@ definitions:
NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
description: Period defines a length of time and amount of coins that will vest.
cosmwasmlifecycle.cosmwasmlifecycle.Params:
emidev98.cosmwasmlifecycle.ExecutionType:
type: string
enum:
- BEGIN_BLOCK
- END_BLOCK
- BEGIN_AND_END_BLOCK
default: BEGIN_BLOCK
emidev98.cosmwasmlifecycle.ExecutionTypeOperation:
type: string
enum:
- ENABLE
- DISABLE
default: ENABLE
emidev98.cosmwasmlifecycle.MsgFundExistentContractResponse:
type: object
emidev98.cosmwasmlifecycle.MsgModifyContractProposalResponse:
type: object
emidev98.cosmwasmlifecycle.MsgRegisterContractProposalResponse:
type: object
emidev98.cosmwasmlifecycle.MsgRemoveContractProposalResponse:
type: object
emidev98.cosmwasmlifecycle.MsgUpdateParamsProposalResponse:
type: object
emidev98.cosmwasmlifecycle.Params:
type: object
properties:
is_enabled:
type: boolean
title: |-
Enable or disable executions
at the begin and end of the block
min_deposit:
description: >-
Minimum deposit to enable contract execution at begin block and/or end
block

This deposit will be burned if the contract execution reaches the max
strikes.
type: object
properties:
denom:
type: string
amount:
type: string
strikes_to_disable_execution:
type: string
format: int64
description: |-
Amount of strikes that the contract can hold before being
disabled from end and beging block executions.
When this happens the min_desposit will also be burned.
description: Params defines the parameters for the module.
cosmwasmlifecycle.cosmwasmlifecycle.QueryParamsResponse:
emidev98.cosmwasmlifecycle.QueryParamsResponse:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
properties:
is_enabled:
type: boolean
title: |-
Enable or disable executions
at the begin and end of the block
min_deposit:
description: >-
Minimum deposit to enable contract execution at begin block and/or
end block

This deposit will be burned if the contract execution reaches the
max strikes.
type: object
properties:
denom:
type: string
amount:
type: string
strikes_to_disable_execution:
type: string
format: int64
description: |-
Amount of strikes that the contract can hold before being
disabled from end and beging block executions.
When this happens the min_desposit will also be burned.
description: QueryParamsResponse is response type for the Query/Params RPC method.
ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse:
type: object
Expand Down
10 changes: 0 additions & 10 deletions proto/cosmwasmlifecycle/execution_type.proto

This file was deleted.

107 changes: 0 additions & 107 deletions proto/cosmwasmlifecycle/tx.proto

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
syntax = "proto3";
package cosmwasmlifecycle;
package emidev98.cosmwasmlifecycle;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmwasmlifecycle/execution_type.proto";
import "emidev98/cosmwasmlifecycle/execution_type.proto";

option go_package = "github.com/emidev98/cosmwasm-lifecycle/x/cosmwasmlifecycle/types";

// Contract defines the parameters for the module.
message Contract {
// Amount of strikes that the contract has at the moment.
int64 strikes = 1;

// Contract's execution type
ExecutionType execution_type = 2;

ExecutionType execution_type = 1;
// Execution frequency
int64 execution_frequency = 2;
// Latest block execution
int64 latest_block_execution = 3;
// Amount of strikes that the contract has at the moment.
int64 strikes = 4;
// Collateral deposited to the contract.
cosmos.base.v1beta1.Coin deposit = 3 [
cosmos.base.v1beta1.Coin deposit = 5 [
(gogoproto.nullable) = false,
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package cosmwasmlifecycle;
package emidev98.cosmwasmlifecycle;

import "cosmos_proto/cosmos.proto";
option go_package = "github.com/emidev98/cosmwasm-lifecycle/x/cosmwasmlifecycle/types";
Expand Down
15 changes: 15 additions & 0 deletions proto/emidev98/cosmwasmlifecycle/execution_type.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package emidev98.cosmwasmlifecycle;

option go_package = "github.com/emidev98/cosmwasm-lifecycle/x/cosmwasmlifecycle/types";

enum ExecutionType {
BEGIN_BLOCK = 0;
END_BLOCK = 1;
BEGIN_AND_END_BLOCK = 2;
}

enum ExecutionTypeOperation {
ENABLE = 0;
DISABLE = 1;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package cosmwasmlifecycle;
package emidev98.cosmwasmlifecycle;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmwasmlifecycle/params.proto";
import "cosmwasmlifecycle/contract.proto";
import "emidev98/cosmwasmlifecycle/params.proto";
import "emidev98/cosmwasmlifecycle/contract.proto";

option go_package = "github.com/emidev98/cosmwasm-lifecycle/x/cosmwasmlifecycle/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package cosmwasmlifecycle;
package emidev98.cosmwasmlifecycle;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package cosmwasmlifecycle;
package emidev98.cosmwasmlifecycle;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmwasmlifecycle/params.proto";
import "emidev98/cosmwasmlifecycle/params.proto";

option go_package = "github.com/emidev98/cosmwasm-lifecycle/x/cosmwasmlifecycle/types";

Expand Down
Loading

0 comments on commit aa7b8f4

Please sign in to comment.