Skip to content

Commit

Permalink
Merge pull request #22 from rsksmart/bugfix/GBI-1585-insertVoteInDB
Browse files Browse the repository at this point in the history
Fixed vote insertion in the database
  • Loading branch information
MaximStanciu8 authored Jan 11, 2024
2 parents c5e49ab + 1befd9f commit 918becc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/lib/FederatorERC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,18 @@ export default class FederatorERC extends Federator {
await AppDataSource.getRepository(Votes).insert({
voted: true,
transactionId: params.transactionId,
transactionData: JSON.stringify(params)
transactionData: JSON.stringify({
transactionId: params.transactionId,
status: receipt.status,
blockHash: receipt.blockHash,
blockNumber: receipt.blockNumber,
transactionHash: receipt.transactionHash,
from: receipt.from,
to: receipt.to,
cumulativeGasUsed: receipt.cumulativeGasUsed,
amount: params.amount,
originalTokenAddress: params.tokenAddress,
})
});
} else {
validateAndVoteReturn.receipt = null;
Expand Down

0 comments on commit 918becc

Please sign in to comment.