Skip to content

Commit

Permalink
waas: use original intent to avoid data loss because of outdated struct
Browse files Browse the repository at this point in the history
  • Loading branch information
marino39 committed Feb 28, 2024
1 parent f51fa38 commit ebcc194
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rpc/send_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func (s *RPC) sendTransaction(
return nil, fmt.Errorf("recovering parent wallet: %w", err)
}

apiIntent := convertToAPIIntent(intent.ToIntent())
// use original intent otherwise we may experience lose of data because of outdated struct
apiIntent := convertToAPIIntent(&intent.Intent)
bundle, err := s.Wallets.GenTransaction(waasContext(ctx), apiIntent)
if err != nil {
return nil, fmt.Errorf("generating transaction: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion rpc/sign_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func (s *RPC) signMessage(
},
}

apiIntent := convertToAPIIntent(intent.ToIntent())
// use original intent otherwise we may experience lose of data because of outdated struct
apiIntent := convertToAPIIntent(&intent.Intent)
res, err := s.Wallets.SignMessage(waasContext(ctx), apiIntent, signMessage, signatures)
if err != nil {
return nil, fmt.Errorf("signing message: %w", err)
Expand Down

0 comments on commit ebcc194

Please sign in to comment.