Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,397 changes: 1,219 additions & 178 deletions api/nova/airdrop/v1/genesis.pulsar.go

Large diffs are not rendered by default.

540 changes: 22 additions & 518 deletions api/nova/airdrop/v1/params.pulsar.go

Large diffs are not rendered by default.

476 changes: 236 additions & 240 deletions api/nova/airdrop/v1/query.pulsar.go

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions api/nova/airdrop/v1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
airdropKeeper := airdropkeeper.NewKeeper(
appCodec,
appKeepers.keys[airdroptypes.StoreKey],
appKeepers.GetSubspace(airdroptypes.ModuleName),
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
)
Expand Down
43 changes: 38 additions & 5 deletions proto/nova/airdrop/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
syntax = "proto3";
package nova.airdrop.v1;

import "nova/airdrop/v1/params.proto";

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/Carina-labs/nova/x/airdrop/types";

message GenesisState {
// params defines all the parameters of module.
Params params = 1;

// states for the airdrop, how much coins are allocated for each address is must be pre-defined.
repeated AirdropState states = 2;

// information for the airdrop
AirdropInfo airdrop_info = 3;
}

message AirdropInfo {
// The snapshot date based for the distribution of the airdrop.
google.protobuf.Timestamp snapshot_timestamp = 1 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];

// THe time when you can claim your airdrop nova tokens.
google.protobuf.Timestamp airdrop_start_timestamp = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];

// THe time when the user no longer can claim the airdrop tokens.
google.protobuf.Timestamp airdrop_end_timestamp = 3 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];

// The denom for the airdrop coin.
string airdrop_denom = 4;

// the number of quests user to do
int32 quests_count = 5;

// controller address is responsible to check the user has performed the social quest (e.g. twitter, facebook or etc)
string controller_address = 6;

// maximum token allocation for each user, an use cannot claim more than this amount;
string maximum_token_alloc_per_user = 7;
}

enum QuestType {
Expand Down Expand Up @@ -62,4 +92,7 @@ message QuestState {
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];

// claimed amount, this field is empty if user not claimed for this quest yet
string claimed_amount = 4;
}
38 changes: 0 additions & 38 deletions proto/nova/airdrop/v1/params.proto

This file was deleted.

14 changes: 5 additions & 9 deletions proto/nova/airdrop/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ import "cosmos/base/v1beta1/coin.proto";
import "google/api/annotations.proto";
import "gogoproto/gogo.proto";

import "nova/airdrop/v1/params.proto";
import "nova/airdrop/v1/genesis.proto";

option go_package = "github.com/Carina-labs/nova/x/airdrop/types";

service Query {
// Params returns the total set of minting parameters.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/nova/airdrop/v1/params";
}
// get airdrop info
rpc AirdropInfo(QueryAirdropInfoRequest) returns (QueryAirdropInfoResponse) {}

// get total assets of the airdrop for a given address
rpc TotalAssetForAirdrop(QueryTotalAssetForAirdropRequest) returns (QueryTotalAssetForAirdropResponse) {
Expand All @@ -27,10 +24,9 @@ service Query {
}
}

message QueryParamsRequest {}
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];
message QueryAirdropInfoRequest {}
message QueryAirdropInfoResponse {
AirdropInfo airdrop_info = 1;
}

message QueryTotalAssetForAirdropRequest {
Expand Down
2 changes: 1 addition & 1 deletion x/airdrop/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) {
k.SetParams(ctx, genState.Params)

}

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion x/airdrop/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewQuerier(k Keeper) Querier {
return Querier{Keeper: k}
}

func (q Querier) Params(ctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
func (q Querier) AirdropInfo(ctx context.Context, request *types.QueryAirdropInfoRequest) (*types.QueryAirdropInfoResponse, error) {
//TODO implement me
panic("implement me")
}
Expand Down
8 changes: 0 additions & 8 deletions x/airdrop/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,25 @@ import (
"github.com/Carina-labs/nova/x/airdrop/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/tendermint/tendermint/libs/log"
)

type Keeper struct {
cdc codec.BinaryCodec
storeKey sdk.StoreKey
paramSpace paramtypes.Subspace
accountKeeper types.AccountKeeper
bankKeeper types.BankKeeper
}

func NewKeeper(
cdc codec.BinaryCodec,
key sdk.StoreKey,
paramSpace paramtypes.Subspace,
accountKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
) Keeper {
if !paramSpace.HasKeyTable() {
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
}

return Keeper{
cdc: cdc,
storeKey: key,
paramSpace: paramSpace,
accountKeeper: accountKeeper,
bankKeeper: bankKeeper,
}
Expand Down
17 changes: 0 additions & 17 deletions x/airdrop/keeper/params.go

This file was deleted.

7 changes: 7 additions & 0 deletions x/airdrop/types/errors.go
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
package types

import "github.com/cosmos/cosmos-sdk/types/errors"

var (
ErrTokenAllocCannotExceedMaxCap = errors.Register(ModuleName, 1, "token allocation cannot exceed max cap")
ErrTimeConditionNotMet = errors.Register(ModuleName, 2, "time condition not met")
)
Loading