-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: reards auction proto * lint * update genesis * fix * add usd rewards * update params * add events * update genesis * update * feat: auction module * module wiring * syntax * comment * fix app keys * fix codec
- Loading branch information
1 parent
764a5c4
commit 7be3d59
Showing
9 changed files
with
318 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package auction | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
cdctypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
// "github.com/cosmos/cosmos-sdk/types/msgservice" | ||
) | ||
|
||
// Amino codecs | ||
// Note, the ModuleCdc should ONLY be used in certain instances of tests and for JSON | ||
// encoding as Amino is still used for that purpose. | ||
var ( | ||
amino = codec.NewLegacyAmino() | ||
ModuleCdc = codec.NewAminoCodec(amino) | ||
) | ||
|
||
func init() { | ||
RegisterLegacyAminoCodec(amino) | ||
cryptocodec.RegisterCrypto(amino) | ||
amino.Seal() | ||
} | ||
|
||
// RegisterLegacyAminoCodec registers the necessary x/uibc interfaces and | ||
// concrete types on the provided LegacyAmino codec. These types are used for | ||
// Amino JSON serialization. | ||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | ||
cdc.RegisterConcrete(&MsgGovSetRewardsParams{}, "umee/auction/MsgGovSetRewardsParams", nil) | ||
cdc.RegisterConcrete(&MsgRewardsBid{}, "umee/auction/MsgRewardsBid", nil) | ||
} | ||
|
||
func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { | ||
registry.RegisterImplementations( | ||
(*sdk.Msg)(nil), | ||
// &MsgGovSetRewardsParams{}, | ||
// &MsgRewardsBid{}, | ||
) | ||
|
||
// TODO | ||
// msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package auction | ||
|
||
// TODO: create a shared interface for bank keeper in /sdkutils | ||
type BankKeeper interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package auction | ||
|
||
// DefaultGenesis creates a default genesis state | ||
func DefaultGenesis() *GenesisState { | ||
// TODO | ||
return &GenesisState{} | ||
} | ||
|
||
func (gs *GenesisState) Validate() error { | ||
// TODO | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package keeper | ||
|
||
import ( | ||
"github.com/umee-network/umee/v6/x/auction" | ||
) | ||
|
||
func (k Keeper) ExportGenesis() *auction.GenesisState { | ||
// TODO | ||
return &auction.GenesisState{} | ||
} | ||
|
||
func (k Keeper) InitGenesis(*auction.GenesisState) { | ||
// TODO | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package keeper | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
type Builder struct { | ||
cdc codec.Codec | ||
storeKey storetypes.StoreKey | ||
} | ||
|
||
func NewBuilder(cdc codec.Codec, key storetypes.StoreKey) Builder { | ||
return Builder{cdc: cdc, storeKey: key} | ||
} | ||
|
||
func (kb Builder) Keeper(ctx *sdk.Context) Keeper { | ||
return Keeper{ | ||
ctx: ctx, | ||
} | ||
} | ||
|
||
type Keeper struct { | ||
ctx *sdk.Context | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package auction | ||
|
||
const ( | ||
// ModuleName defines the module name | ||
ModuleName = "auction" | ||
|
||
// StoreKey defines the primary module store key | ||
StoreKey = ModuleName | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package module | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/umee-network/umee/v6/x/incentive" | ||
"github.com/umee-network/umee/v6/x/incentive/keeper" | ||
) | ||
|
||
// InitGenesis initializes the x/incentive module's state from a provided genesis | ||
// state. | ||
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState incentive.GenesisState) { | ||
k.InitGenesis(ctx, genState) | ||
} | ||
|
||
// ExportGenesis returns the x/incentive module's exported genesis state. | ||
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *incentive.GenesisState { | ||
return k.ExportGenesis(ctx) | ||
} |
Oops, something went wrong.