Skip to content

Commit 73ea989

Browse files
committed
Fixes for Swap RPC
1 parent 1f48e26 commit 73ea989

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/code/server/transaction/swap.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (s *transactionServer) Swap(streamer transactionpb.Transaction_SwapServer)
172172
continue
173173
}
174174

175-
alt, err := transaction.GetAltForMint(ctx, s.data, fromMint)
175+
alt, err := transaction.GetAltForMint(ctx, s.data, mint)
176176
if err != nil {
177177
log.WithError(err).Warn("failure getting alt")
178178
return handleSwapError(streamer, err)
@@ -200,6 +200,7 @@ func (s *transactionServer) Swap(streamer transactionpb.Transaction_SwapServer)
200200
txn.SetBlockhash(blockhash)
201201

202202
marshalledTxn := txn.Marshal()
203+
marshalledTxnMessage := txn.Message.Marshal()
203204

204205
//
205206
// Section: Server parameters
@@ -269,7 +270,7 @@ func (s *transactionServer) Swap(streamer transactionpb.Transaction_SwapServer)
269270

270271
if !ed25519.Verify(
271272
account,
272-
marshalledTxn,
273+
marshalledTxnMessage,
273274
protoSignature.Value,
274275
) {
275276
return handleSwapStructuredError(
@@ -297,7 +298,7 @@ func (s *transactionServer) Swap(streamer transactionpb.Transaction_SwapServer)
297298
// Section: Transaction submission
298299
//
299300

300-
log = log.WithField("txn", base64.StdEncoding.EncodeToString(txn.Marshal()))
301+
log = log.WithField("txn", base64.StdEncoding.EncodeToString(marshalledTxn))
301302

302303
_, err = s.data.SubmitBlockchainTransaction(ctx, &txn)
303304
if err != nil {

0 commit comments

Comments
 (0)