Skip to content

Commit

Permalink
MN-761: use TransferToDeposit request reference as txID (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
uhzxl authored Sep 4, 2020
1 parent dbc9e6c commit 90a2e08
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion application/builtin/contract/deposit/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,19 @@ func (d *Deposit) TransferToDeposit(
}
d.Balance = newBalance.String()
destination := deposit.GetObject(toDeposit)

// We will use the reference of the current request as the transaction ID.
txID, err := foundation.GetRequestReference()
if err != nil {
return errors.Wrap(err, "failed to get current request reference")
}
if txID == nil {
return errors.New("invalid logical context. request reference is nil")
}
acceptDepositErr := destination.Accept(appfoundation.SagaAcceptInfo{
Amount: amountStr,
FromMember: fromMember,
Request: request,
Request: *txID,
})
if acceptDepositErr == nil {
return nil
Expand Down

0 comments on commit 90a2e08

Please sign in to comment.