Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/airdrop-claim' into…
Browse files Browse the repository at this point in the history
… airdrop-claim
  • Loading branch information
99adarsh committed Dec 13, 2024
2 parents da9934e + a6ebbbd commit d091817
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 214 deletions.
249 changes: 124 additions & 125 deletions api/elys/commitment/tx.pulsar.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion proto/elys/commitment/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ message MsgUnstakeResponse {
message MsgClaimAirdrop {
option (cosmos.msg.v1.signer) = "creator";
option (amino.name) = "commitment/MsgClaimAirdrop";
string claim_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

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

const MaxElysAmount = 3_218_460_000_000
const MaxEdenAmount = 3_316_344_000_000
const MaxEdenAmount = 3_441_097_000_000

func (k Keeper) GetAtomStaker(ctx sdk.Context, address sdk.AccAddress) (val types.AtomStaker) {
store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx))
Expand Down
2 changes: 1 addition & 1 deletion x/commitment/keeper/msg_server_claim_airdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var AirdropWallet = "elys1wk7jwkqt2h9cnpkst85j9n454e4y8znlgk842n"

func (k msgServer) ClaimAirdrop(goCtx context.Context, msg *types.MsgClaimAirdrop) (*types.MsgClaimAirdropResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
sender := sdk.MustAccAddressFromBech32(msg.ClaimAddress)
sender := sdk.MustAccAddressFromBech32(msg.Creator)
airdropWallet := sdk.MustAccAddressFromBech32(AirdropWallet)
params := k.GetParams(ctx)

Expand Down
4 changes: 2 additions & 2 deletions x/commitment/keeper/msg_server_claim_airdrop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestAirdropClaim(t *testing.T) {
})

claimAirdropMsg := &types.MsgClaimAirdrop{
ClaimAddress: creator.String(),
Creator: creator.String(),
}

_, err = msgServer.ClaimAirdrop(ctx, claimAirdropMsg)
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestAirdropClaim(t *testing.T) {
})

claimAirdropMsg = &types.MsgClaimAirdrop{
ClaimAddress: addr[1].String(),
Creator: addr[1].String(),
}

ctx = ctx.WithBlockHeight(50)
Expand Down
2 changes: 1 addition & 1 deletion x/commitment/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (am AppModule) BeginBlock(_ context.Context) error {
}

// EndBlock contains the logic that is automatically triggered at the end of each block
func (am AppModule) EndBlock(_ context.Context) error {
func (am AppModule) EndBlock(goCtx context.Context) error {

Check warning on line 166 in x/commitment/module.go

View check run for this annotation

Codecov / codecov/patch

x/commitment/module.go#L166

Added line #L166 was not covered by tests
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions x/commitment/types/message_claim_airdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ var _ sdk.Msg = &MsgCancelVest{}

func NewMsgClaimAirdrop(creator string) *MsgClaimAirdrop {
return &MsgClaimAirdrop{
ClaimAddress: creator,
Creator: creator,
}
}

func (msg *MsgClaimAirdrop) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(msg.ClaimAddress)
_, err := sdk.AccAddressFromBech32(msg.Creator)
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}
Expand Down
161 changes: 80 additions & 81 deletions x/commitment/types/tx.pb.go

Large diffs are not rendered by default.

0 comments on commit d091817

Please sign in to comment.