Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lock id to return value of MsgSuperfluidUndelegateAndUnbondLockResponse #4974

Merged
merged 4 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#4892](https://github.com/osmosis-labs/osmosis/pull/4847) Update Golang to 1.20
* [#4893](https://github.com/osmosis-labs/osmosis/pull/4893) Update alpine docker base image to `alpine:3.17`
* [#4912](https://github.com/osmosis-labs/osmosis/pull/4912) Export Position_lock_id mappings to GenesisState
* [#4974](https://github.com/osmosis-labs/osmosis/pull/4974) Add lock id to `MsgSuperfluidUndelegateAndUnbondLockResponse`

### API breaks

Expand Down
7 changes: 6 additions & 1 deletion proto/osmosis/superfluid/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ message MsgSuperfluidUndelegateAndUnbondLock {
cosmos.base.v1beta1.Coin coin = 3
[ (gogoproto.moretags) = "yaml:\"coin\"", (gogoproto.nullable) = false ];
}
message MsgSuperfluidUndelegateAndUnbondLockResponse {}
message MsgSuperfluidUndelegateAndUnbondLockResponse {
// lock id of the new lock created for the remaining amount.
// returns the original lockid if the unlocked amount is eqaul to the
mattverse marked this conversation as resolved.
Show resolved Hide resolved
// original lock's amount.
uint64 lock_id = 1;
}

// message MsgSuperfluidRedelegate {
// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
Expand Down
4 changes: 2 additions & 2 deletions x/superfluid/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ func (server msgServer) SuperfluidUndelegateAndUnbondLock(goCtx context.Context,
) {
ctx := sdk.UnwrapSDKContext(goCtx)

_, err := server.keeper.SuperfluidUndelegateAndUnbondLock(ctx, msg.LockId, msg.Sender, msg.Coin.Amount)
lockId, err := server.keeper.SuperfluidUndelegateAndUnbondLock(ctx, msg.LockId, msg.Sender, msg.Coin.Amount)
if err == nil {
events.EmitSuperfluidUndelegateAndUnbondLockEvent(ctx, msg.LockId)
}
return &types.MsgSuperfluidUndelegateAndUnbondLockResponse{}, err
return &types.MsgSuperfluidUndelegateAndUnbondLockResponse{LockId: lockId}, err
}

// LockAndSuperfluidDelegate locks and superfluid delegates given tokens in a single message.
Expand Down
157 changes: 98 additions & 59 deletions x/superfluid/types/tx.pb.go

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