Skip to content

Commit 9f73b3a

Browse files
committed
wip
1 parent 74c47b1 commit 9f73b3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+331
-1327
lines changed

app/app.go

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ import (
8080
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
8181
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
8282
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
83+
crontypes "github.com/scrtlabs/SecretNetwork/x/cron/types"
8384

8485
"cosmossdk.io/log"
8586
upgradetypes "cosmossdk.io/x/upgrade/types"
@@ -580,6 +581,7 @@ func SetOrderBeginBlockers(app *SecretNetworkApp) {
580581
compute.ModuleName,
581582
reg.ModuleName,
582583
ibcswitchtypes.ModuleName,
584+
crontypes.ModuleName,
583585
)
584586
}
585587

@@ -613,6 +615,7 @@ func SetOrderInitGenesis(app *SecretNetworkApp) {
613615

614616
ibcfeetypes.ModuleName,
615617
feegrant.ModuleName,
618+
crontypes.ModuleName,
616619
)
617620
}
618621

@@ -642,5 +645,6 @@ func SetOrderEndBlockers(app *SecretNetworkApp) {
642645
compute.ModuleName,
643646
reg.ModuleName,
644647
ibcswitchtypes.ModuleName,
648+
crontypes.ModuleName,
645649
)
646650
}

app/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/cosmos/ibc-go/v8/modules/apps/transfer"
3434
ibc "github.com/cosmos/ibc-go/v8/modules/core"
3535
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
36+
"github.com/scrtlabs/SecretNetwork/x/cron"
3637
ibcswitch "github.com/scrtlabs/SecretNetwork/x/emergencybutton"
3738

3839
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -78,6 +79,7 @@ var mbasics = module.NewBasicManager(
7879
ica.AppModuleBasic{},
7980
packetforwardrouter.AppModuleBasic{},
8081
ibcfee.AppModuleBasic{},
82+
cron.AppModuleBasic{},
8183
},
8284
// our stuff
8385
customModuleBasics()...,

app/keepers/keepers.go

+17
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ import (
5454
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
5555
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
5656
"github.com/scrtlabs/SecretNetwork/x/compute"
57+
cronkeeper "github.com/scrtlabs/SecretNetwork/x/cron/keeper"
58+
crontypes "github.com/scrtlabs/SecretNetwork/x/cron/types"
59+
5760
reg "github.com/scrtlabs/SecretNetwork/x/registration"
5861

5962
ibcpacketforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper"
@@ -80,6 +83,7 @@ type SecretAppKeepers struct {
8083
AuthzKeeper *authzkeeper.Keeper
8184
BankKeeper *bankkeeper.BaseKeeper
8285
CapabilityKeeper *capabilitykeeper.Keeper
86+
CronKeeper *cronkeeper.Keeper
8387
StakingKeeper *stakingkeeper.Keeper
8488
SlashingKeeper *slashingkeeper.Keeper
8589
MintKeeper *mintkeeper.Keeper
@@ -240,6 +244,15 @@ func (ak *SecretAppKeepers) InitSdkKeepers(
240244
)
241245
ak.CrisisKeeper = crisisKeeper
242246

247+
cronKeeper := cronkeeper.NewKeeper(
248+
appCodec,
249+
ak.keys[crontypes.StoreKey],
250+
ak.memKeys[crontypes.StoreKey],
251+
ak.AccountKeeper,
252+
authtypes.NewModuleAddress(crontypes.ModuleName).String(),
253+
)
254+
ak.CronKeeper = cronKeeper
255+
243256
feegrantKeeper := feegrantkeeper.NewKeeper(
244257
appCodec,
245258
runtime.NewKVStoreService(ak.keys[feegrant.StoreKey]),
@@ -543,6 +556,8 @@ func (ak *SecretAppKeepers) InitCustomKeepers(
543556
ak.ComputeKeeper = &computeKeeper
544557
wasmHooks.ContractKeeper = ak.ComputeKeeper
545558

559+
ak.CronKeeper.WasmMsgServer = compute.NewMsgServerImpl(*ak.ComputeKeeper)
560+
546561
// Compute receive: Switch -> Fee -> Packet Forward -> WASM Hooks
547562
var computeStack porttypes.IBCModule
548563
computeStack = compute.NewIBCHandler(ak.ComputeKeeper, ak.IbcKeeper.ChannelKeeper, ak.IbcFeeKeeper)
@@ -596,6 +611,7 @@ func (ak *SecretAppKeepers) InitKeys() {
596611
ibcswitch.StoreKey,
597612
ibchookstypes.StoreKey,
598613
crisistypes.StoreKey,
614+
crontypes.StoreKey,
599615
)
600616

601617
ak.tKeys = storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
@@ -621,6 +637,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
621637
paramsKeeper.Subspace(reg.ModuleName)
622638
paramsKeeper.Subspace(ibcpacketforwardtypes.ModuleName).WithKeyTable(ibcpacketforwardtypes.ParamKeyTable())
623639
paramsKeeper.Subspace(ibcswitch.ModuleName).WithKeyTable(ibcswitchtypes.ParamKeyTable())
640+
paramsKeeper.Subspace(crontypes.ModuleName)
624641

625642
return paramsKeeper
626643
}

app/modules.go

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import (
4040
ibc "github.com/cosmos/ibc-go/v8/modules/core"
4141
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
4242
"github.com/scrtlabs/SecretNetwork/x/compute"
43+
"github.com/scrtlabs/SecretNetwork/x/cron"
44+
crontypes "github.com/scrtlabs/SecretNetwork/x/cron/types"
4345
ibcswitch "github.com/scrtlabs/SecretNetwork/x/emergencybutton"
4446
reg "github.com/scrtlabs/SecretNetwork/x/registration"
4547
)
@@ -56,6 +58,7 @@ var ModuleAccountPermissions = map[string][]string{
5658
ibcfeetypes.ModuleName: nil,
5759
ibcswitch.ModuleName: nil,
5860
compute.ModuleName: {authtypes.Burner},
61+
crontypes.ModuleName: nil,
5962
}
6063

6164
func Modules(
@@ -90,5 +93,6 @@ func Modules(
9093
packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper, app.AppKeepers.GetSubspace(packetforwardtypes.ModuleName)),
9194
ibcfee.NewAppModule(app.AppKeepers.IbcFeeKeeper),
9295
ibcswitch.NewAppModule(app.AppKeepers.IbcSwitchKeeper, app.AppKeepers.GetSubspace(ibcswitch.ModuleName)),
96+
cron.NewAppModule(app.appCodec, *app.AppKeepers.CronKeeper),
9397
}
9498
}

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ require (
6969
github.com/cosmos/cosmos-proto v1.0.0-beta.5
7070
github.com/cosmos/rosetta v0.50.4
7171
github.com/gogo/protobuf v1.3.2
72+
github.com/hashicorp/go-metrics v0.5.3
7273
github.com/scrtlabs/tm-secret-enclave v1.11.8
7374
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
75+
gopkg.in/yaml.v2 v2.4.0
7476
)
7577

7678
require (
@@ -152,7 +154,6 @@ require (
152154
github.com/hashicorp/go-getter v1.7.4 // indirect
153155
github.com/hashicorp/go-hclog v1.5.0 // indirect
154156
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
155-
github.com/hashicorp/go-metrics v0.5.3 // indirect
156157
github.com/hashicorp/go-plugin v1.5.2 // indirect
157158
github.com/hashicorp/go-safetemp v1.0.0 // indirect
158159
github.com/hashicorp/go-version v1.6.0 // indirect
@@ -224,7 +225,6 @@ require (
224225
google.golang.org/api v0.186.0 // indirect
225226
google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect
226227
gopkg.in/ini.v1 v1.67.0 // indirect
227-
gopkg.in/yaml.v2 v2.4.0 // indirect
228228
gopkg.in/yaml.v3 v3.0.1 // indirect
229229
gotest.tools/v3 v3.5.1 // indirect
230230
nhooyr.io/websocket v1.8.6 // indirect

proto/secret/cron/genesis.proto

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
syntax = "proto3";
2-
package neutron.cron;
2+
package secret.cron;
33

44
import "gogoproto/gogo.proto";
5-
import "neutron/cron/params.proto";
6-
import "neutron/cron/schedule.proto";
5+
import "secret/cron/params.proto";
6+
import "secret/cron/schedule.proto";
77
// this line is used by starport scaffolding # genesis/proto/import
88

9-
option go_package = "github.com/neutron-org/neutron/v5/x/cron/types";
9+
option go_package = "github.com/scrtlabs/SecretNetwork/x/cron/types";
1010

1111
// Defines the cron module's genesis state.
1212
message GenesisState {

proto/secret/cron/params.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
syntax = "proto3";
2-
package neutron.cron;
2+
package secret.cron;
33

44
import "gogoproto/gogo.proto";
55

6-
option go_package = "github.com/neutron-org/neutron/v5/x/cron/types";
6+
option go_package = "github.com/scrtlabs/SecretNetwork/x/cron/types";
77

88
// Defines the parameters for the module.
99
message Params {

proto/secret/cron/query.proto

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
syntax = "proto3";
2-
package neutron.cron;
2+
package secret.cron;
33

44
import "cosmos/base/query/v1beta1/pagination.proto";
55
import "gogoproto/gogo.proto";
66
import "google/api/annotations.proto";
7-
import "neutron/cron/params.proto";
8-
import "neutron/cron/schedule.proto";
7+
import "secret/cron/params.proto";
8+
import "secret/cron/schedule.proto";
99
// this line is used by starport scaffolding # 1
1010

11-
option go_package = "github.com/neutron-org/neutron/v5/x/cron/types";
11+
option go_package = "github.com/scrtlabs/SecretNetwork/x/cron/types";
1212

1313
// Defines the gRPC querier service.
1414
service Query {
1515
// Queries the parameters of the module.
1616
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
17-
option (google.api.http).get = "/neutron/cron/params";
17+
option (google.api.http).get = "/secret/cron/params";
1818
}
1919

2020
// Queries a Schedule by name.
2121
rpc Schedule(QueryGetScheduleRequest) returns (QueryGetScheduleResponse) {
22-
option (google.api.http).get = "/neutron/cron/schedule/{name}";
22+
option (google.api.http).get = "/secret/cron/schedule/{name}";
2323
}
2424

2525
// Queries a list of Schedule items.
2626
rpc Schedules(QuerySchedulesRequest) returns (QuerySchedulesResponse) {
27-
option (google.api.http).get = "/neutron/cron/schedule";
27+
option (google.api.http).get = "/secret/cron/schedule";
2828
}
2929

3030
// this line is used by starport scaffolding # 2

proto/secret/cron/schedule.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
syntax = "proto3";
2-
package neutron.cron;
2+
package secret.cron;
33

44
import "gogoproto/gogo.proto";
55

6-
option go_package = "github.com/neutron-org/neutron/v5/x/cron/types";
6+
option go_package = "github.com/scrtlabs/SecretNetwork/x/cron/types";
77

88
// Defines when messages will be executed in the block
99
enum ExecutionStage {

proto/secret/cron/tx.proto

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
syntax = "proto3";
2-
package neutron.cron;
2+
package secret.cron;
33

44
import "amino/amino.proto";
55
import "cosmos/msg/v1/msg.proto";
66
import "cosmos_proto/cosmos.proto";
77
import "gogoproto/gogo.proto";
8-
import "neutron/cron/params.proto";
9-
import "neutron/cron/schedule.proto";
8+
import "secret/cron/params.proto";
9+
import "secret/cron/schedule.proto";
1010

1111
// this line is used by starport scaffolding # proto/tx/import
1212

13-
option go_package = "github.com/neutron-org/neutron/v5/x/cron/types";
13+
option go_package = "github.com/scrtlabs/SecretNetwork/x/cron/types";
1414

1515
// Defines the Msg service.
1616
service Msg {

proto/secret/cron/v1/schedule.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
syntax = "proto3";
2-
package neutron.cron.v1;
2+
package secret.cron.v1;
33

44
import "gogoproto/gogo.proto";
55

6-
option go_package = "github.com/neutron-org/neutron/v5/x/cron/types/v1";
6+
option go_package = "github.com/scrtlabs/SecretNetwork/x/cron/types/v1";
77

88
// Defines the schedule for execution
99
message Schedule {

x/cron/client/cli/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/cosmos/cosmos-sdk/client"
99

10-
"github.com/neutron-org/neutron/v5/x/cron/types"
10+
"github.com/scrtlabs/SecretNetwork/x/cron/types"
1111
)
1212

1313
// GetQueryCmd returns the cli query commands for this module

x/cron/client/cli/query_params.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import (
55

66
"github.com/cosmos/cosmos-sdk/client"
77
"github.com/cosmos/cosmos-sdk/client/flags"
8+
"github.com/scrtlabs/SecretNetwork/x/cron/types"
89
"github.com/spf13/cobra"
9-
10-
"github.com/neutron-org/neutron/v5/x/cron/types"
1110
)
1211

1312
func CmdQueryParams() *cobra.Command {

x/cron/client/cli/query_schedule.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/cosmos/cosmos-sdk/client/flags"
88
"github.com/spf13/cobra"
99

10-
"github.com/neutron-org/neutron/v5/x/cron/types"
10+
"github.com/scrtlabs/SecretNetwork/x/cron/types"
1111
)
1212

1313
func CmdListSchedule() *cobra.Command {

0 commit comments

Comments
 (0)