forked from cerc-io/laconicd
Prathamesh Musale
c79b7bea7d
- Implement auction and bond module hooks in registry module - Code cleanup Reviewed-on: deep-stack/laconic2d#9 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
20 lines
672 B
Go
20 lines
672 B
Go
package bond
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// BondUsageKeeper keep track of bond usage in other modules.
|
|
// Used to, for example, prevent deletion of a bond that's in use.
|
|
type BondUsageKeeper interface {
|
|
ModuleName() string
|
|
UsesBond(ctx sdk.Context, bondId string) bool
|
|
}
|
|
|
|
// BondHooksWrapper is a wrapper for modules to inject BondUsageKeeper using depinject.
|
|
// Reference: https://github.com/cosmos/cosmos-sdk/tree/v0.50.3/core/appmodule#resolving-circular-dependencies
|
|
type BondHooksWrapper struct{ BondUsageKeeper }
|
|
|
|
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
|
func (BondHooksWrapper) IsOnePerModuleType() {}
|