Skip to content

Commit

Permalink
Merge pull request #9794 from vegaprotocol/9773
Browse files Browse the repository at this point in the history
fix: map network owner correctly in creating account from transfer
  • Loading branch information
EVODelavega authored Oct 16, 2023
2 parents e540a44 + 5ecbba4 commit 1fbfa68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@
- [8157](https://github.com/vegaprotocol/vega/issues/8157) - Handle kill/interrupt signals in datanode, and clean up properly.
- [7914](https://github.com/vegaprotocol/vega/issues/7914) - Offer node signatures after snapshot restore
- [8187](https://github.com/vegaprotocol/vega/issues/8187) - Expose Live Only filter to the `GraphQL` Orders filter.
- [9793](https://github.com/vegaprotocol/vega/issues/9793) - Map network owner correctly in creating account from transfer.

## 0.70.0

Expand Down
8 changes: 8 additions & 0 deletions datanode/entities/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ func TransferFromProto(ctx context.Context, t *eventspb.Transfer, txHash TxHash,
VegaTime: time.Unix(0, t.Timestamp),
}

if t.From == "0000000000000000000000000000000000000000000000000000000000000000" {
fromAcc.PartyID = PartyID("network")
}

err := accountSource.Obtain(ctx, &fromAcc)
if err != nil {
return nil, fmt.Errorf("obtaining from account id for transfer:%w", err)
Expand All @@ -151,6 +155,10 @@ func TransferFromProto(ctx context.Context, t *eventspb.Transfer, txHash TxHash,
VegaTime: vegaTime,
}

if t.To == "0000000000000000000000000000000000000000000000000000000000000000" {
toAcc.PartyID = PartyID("network")
}

err = accountSource.Obtain(ctx, &toAcc)

if err != nil {
Expand Down

0 comments on commit 1fbfa68

Please sign in to comment.