-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add batch claim deposits * remove old claimdeposit msg (cherry picked from commit cdc0e4f) Co-authored-by: tkernell <[email protected]>
- Loading branch information
1 parent
76c2d53
commit 67bb26b
Showing
11 changed files
with
875 additions
and
564 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
"strconv" | ||
|
||
"github.com/tellor-io/layer/x/bridge/types" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
func (k msgServer) ClaimDeposits(goCtx context.Context, msg *types.MsgClaimDepositsRequest) (*types.MsgClaimDepositsResponse, error) { | ||
sdkCtx := sdk.UnwrapSDKContext(goCtx) | ||
if len(msg.DepositIds) != len(msg.Indices) { | ||
return nil, types.ErrInvalidDepositIdsAndIndicesLength | ||
} | ||
msgSender := sdk.MustAccAddressFromBech32(msg.Creator) | ||
for i, depositId := range msg.DepositIds { | ||
index := msg.Indices[i] | ||
if err := k.Keeper.ClaimDeposit(sdkCtx, depositId, index, msgSender); err != nil { | ||
return nil, err | ||
} | ||
sdk.UnwrapSDKContext(goCtx).EventManager().EmitEvents(sdk.Events{ | ||
sdk.NewEvent( | ||
"deposit_claimed", | ||
sdk.NewAttribute("deposit_id", strconv.FormatUint(depositId, 10)), | ||
), | ||
}) | ||
} | ||
|
||
return &types.MsgClaimDepositsResponse{}, 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.