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

Base signalling intent off the most recent claims #1345

Merged
merged 4 commits into from
Mar 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion x/interchainstaking/keeper/intent.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (k *Keeper) AggregateDelegatorIntents(ctx sdk.Context, zone *types.Zone) er
balance := sdk.NewCoin(zone.LocalDenom, sdkmath.ZeroInt())
// grab offchain asset value, and raise the users' base value by this amount.
// currently ignoring base value (locally held assets)
k.ClaimsManagerKeeper.IterateLastEpochUserClaims(ctx, zone.ChainId, delIntent.Delegator, func(index int64, data prtypes.Claim) (stop bool) {
k.ClaimsManagerKeeper.IterateUserClaims(ctx, zone.ChainId, delIntent.Delegator, func(index int64, data prtypes.Claim) (stop bool) {
balance.Amount = balance.Amount.Add(data.Amount)
// claim amounts are in zone.baseDenom - but given weights are all relative to one another this okay.
k.Logger(ctx).Debug(
Expand Down
1 change: 1 addition & 0 deletions x/interchainstaking/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type IcsHooks interface {

type ClaimsManagerKeeper interface {
IterateLastEpochUserClaims(ctx sdk.Context, chainID, address string, fn func(index int64, data claimsmanagertypes.Claim) (stop bool))
IterateUserClaims(ctx sdk.Context, chainID, address string, fn func(index int64, data claimsmanagertypes.Claim) (stop bool))
SetClaim(ctx sdk.Context, claim *claimsmanagertypes.Claim)
}

Expand Down
Loading