You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
depinject can automatically add your hooks to the epochs `Keeper`. For it do so, specify an output of your module with the type `epochtypes.EpochHooksWrapper`, ie:
243
+
244
+
```go
245
+
typeTestInputsstruct {
246
+
depinject.In
247
+
}
248
+
249
+
typeTestOutputsstruct {
250
+
depinject.Out
251
+
252
+
Hooks types.EpochHooksWrapper
253
+
}
254
+
255
+
funcDummyProvider(inTestInputs) TestOutputs {
256
+
return TestOutputs{
257
+
Hooks: types.EpochHooksWrapper{
258
+
EpochHooks: testEpochHooks{},
259
+
},
260
+
}
261
+
}
262
+
```
263
+
264
+
for an example see [`depinject_test.go`](https://github.com/cosmos/cosmos-sdk/tree/main/x/epochs/depinject_test.go)
265
+
98
266
### Panic isolation
99
267
100
268
If a given epoch hook panics, its state update is reverted, but we keep
0 commit comments