Skip to content

Commit

Permalink
feat(x/bank): add origin address in event multisend (#21460)
Browse files Browse the repository at this point in the history
(cherry picked from commit 33c463e)

# Conflicts:
#	x/bank/keeper/keeper_test.go
#	x/bank/keeper/send.go
  • Loading branch information
julienrbrt authored and mergify[bot] committed Aug 29, 2024
1 parent 2f81f5c commit a8cb919
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions x/bank/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {

event2 := sdk.Event{
Type: banktypes.EventTypeTransfer,
<<<<<<< HEAD

Check failure on line 1452 in x/bank/keeper/keeper_test.go

View workflow job for this annotation

GitHub Actions / tests (02)

expected operand, found '<<'
Attributes: []abci.EventAttribute{},
}
event2.Attributes = append(
Expand All @@ -1469,6 +1470,26 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {
event3.Attributes = append(
event3.Attributes,
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()},
=======
Attributes: []coreevent.Attribute{},
}
event1.Attributes = append(
event1.Attributes,
coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc2StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()},
)

event2 := coreevent.Event{
Type: banktypes.EventTypeTransfer,
Attributes: []coreevent.Attribute{},
}
event2.Attributes = append(
event2.Attributes,
coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc3StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()},
>>>>>>> 33c463ec2 (feat(x/bank): add origin address in event multisend (#21460))
)
// events are shifted due to the funding account events
require.Equal(abci.Event(event1), events[25])
Expand Down
10 changes: 10 additions & 0 deletions x/bank/keeper/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input,
return err
}

<<<<<<< HEAD

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '<<'

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }

Check failure on line 184 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }
sdkCtx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeTransfer,
Expand All @@ -197,6 +198,15 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input,
if !accExists {
defer telemetry.IncrCounter(1, "new", "account")
k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, outAddress))
=======

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '=='

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ==, expected }

Check failure on line 201 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ==, expected }
if err := k.EventService.EventManager(ctx).EmitKV(
types.EventTypeTransfer,
event.NewAttribute(types.AttributeKeyRecipient, out.Address),
event.NewAttribute(types.AttributeKeySender, input.Address),
event.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()),
); err != nil {
return err
>>>>>>> 33c463ec2 (feat(x/bank): add origin address in event multisend (#21460))

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '>>'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / dependency-review

illegal character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 209 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'
}
}

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: non-declaration statement outside function body

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: non-declaration statement outside function body

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: non-declaration statement outside function body

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: non-declaration statement outside function body

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: non-declaration statement outside function body

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: non-declaration statement outside function body

Check failure on line 211 in x/bank/keeper/send.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: non-declaration statement outside function body

Expand Down

0 comments on commit a8cb919

Please sign in to comment.