Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle tx with no inputs #181

Merged
merged 5 commits into from
Aug 20, 2024
Merged

Conversation

andreabadesso
Copy link
Collaborator

Motivation

This fixes an error happening when transactions with no inputs and outputs are voided (i.e. PoA blocks or nano contract transactions)

2024-07-10T21:00:31.621Z [wallet-service-daemon][[32minfo[39m]: Processing event: "error.platform.handlingVoidedTx:invocation[0]"
2024-07-10T21:00:31.621Z [wallet-service-daemon][[32minfo[39m]: Transitioned to "ERROR"
2024-07-10T21:00:31.620Z [wallet-service-daemon][[31merror[39m]: {"type":"error.platform.handlingVoidedTx:invocation[0]","data":{"message":"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3","code":"ER_PARSE_ERROR","errno":1064,"sql":"\n UPDATE `tx_output`\n SET `voided` = TRUE\n WHERE `tx_id` IN ()","sqlState":"42000","sqlMessage":"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3","level":"\u001b[34mdebug\u001b[39m","timestamp":"2024-07-10T21:00:31.617Z"}}
2024-07-10T21:00:31.606Z [wallet-service-daemon][[32minfo[39m]: Processing event: "done.invoke.SyncMachine.CONNECTED.handlingMetadataChanged.detectingDiff:invocation[0]"
2024-07-10T21:00:31.606Z [wallet-service-daemon][[32minfo[39m]: Transitioned to {"CONNECTED":"handlingVoidedTx"}
2024-07-10T21:00:31.592Z [wallet-service-daemon][[32minfo[39m]: Transitioned to {"CONNECTED":{"handlingMetadataChanged":"detectingDiff"}}
2024-07-10T21:00:31.587Z [wallet-service-daemon][[32minfo[39m]: Processing event: "FULLNODE_EVENT"
2024-07-10T21:00:31.584Z [wallet-service-daemon][[32minfo[39m]: Transitioned to {"CONNECTED":"idle"}
2024-07-10T21:00:31.578Z [wallet-service-daemon][[32minfo[39m]: Processing event: "done.invoke.handlingVertexAccepted:invocation[0]"
2024-07-10T21:00:31.550Z [wallet-service-daemon][[31merror[39m]: Transaction 5f08690759f479d07459978ffb843500951bdb0699ed61f204e642abdbad7fa2 already in the database, this should only happen if the service has been recently restarted
2024-07-10T21:00:31.544Z [wallet-service-daemon][[32minfo[39m]: Transitioned to {"CONNECTED":"handlingVertexAccepted"}
2024-07-10T21:00:31.543Z [wallet-service-daemon][[32minfo[39m]: Processing event: "FULLNODE_EVENT"
2024-07-10T21:00:31.537Z [wallet-service-daemon][[32minfo[39m]: Processing event: "WEBSOCKET_EVENT"
2024-07-10T21:00:31.537Z [wallet-service-daemon][[32minfo[39m]: Transitioned to {"CONNECTED":"idle"}
2024-07-10T21:00:31.501Z [wallet-service-daemon][[32minfo[39m]: Processing event: "done.invoke.SyncMachine.INITIALIZING:invocation[0]"
2024-07-10T21:00:31.501Z [wallet-service-daemon][[32minfo[39m]: Transitioned to "CONNECTING"
2024-07-10T21:00:31.393Z [wallet-service-daemon][[32minfo[39m]: Transitioned to "INITIALIZING"
2024-07-10T21:00:31.392Z [wallet-service-daemon][[32minfo[39m]: Processing event: "xstate.init"
2024-07-10T21:00:31.352Z [wallet-service-daemon][[32minfo[39m]: Healthcheck feature is disabled. Not starting healthcheck actor

Acceptance Criteria

  • We should handle properly transactions with no inputs

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged
  • Make sure either the unit tests and/or the QA tests are capable of testing the new features
  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@andreabadesso andreabadesso force-pushed the fix/handle-tx-with-no-io branch from 95163af to b67edfc Compare July 30, 2024 13:56
@andreabadesso andreabadesso requested review from glevco and luislhl July 30, 2024 14:39
@andreabadesso andreabadesso self-assigned this Jul 30, 2024
@andreabadesso andreabadesso added the bug Something isn't working label Jul 30, 2024
@andreabadesso andreabadesso merged commit 9e8959d into master Aug 20, 2024
1 check passed
@andreabadesso andreabadesso deleted the fix/handle-tx-with-no-io branch August 20, 2024 12:46
@andreabadesso andreabadesso mentioned this pull request Dec 9, 2024
2 tasks
andreabadesso added a commit that referenced this pull request Dec 9, 2024
* chore: deploy Nano Testnet (#168)

* fix: fetchMinRewardBlocks fails when reward_min_blocks is 0 (#177)

* fix: handle tx with no inputs and outputs (#178)

* chore: added NODE_ENV to integration tests

* fix: stop failing when there are no address balance on a transaction

* tests: added tests for the voidTransaction method

* chore: re-add test_images_down

* feat: allow sending alerts to another account (#179)

* fix: handle tx with no inputs (#181)

* tests: added tests for the voidTransaction method

* chore: re-add test_images_down

* fix: markUtxosAsVoided should not throw when inputs are empty

* fix: returning empty object on db utils and added test for services including db

* tests: fix invalid order of calls

* tests: missing tests [part 1/2] (#183)

* tests: added missing tests

* tests: added missing tests for nft push

* chore: added docker-compose to flake

* tests: ts-ignore -> ts-expect-error

* feat: handling the vertex_removed event (#182)

* feat: handling the vertex_removed event

* fix: handling empty arrays on IN conditions

* feat: handling VERTEX_REMOVED event

* tests: fix last event

* feat: voiding and removing transaction on vertex_removed event

* tests: added tests for empty array errors

* chore: using port 8085

* chore: actually using 8085

* refactor: removed misleading comment

* ci: support sub-accounts (#184)

* fix: non-standard scripts (#185)

* fix: handling utxos with empty scripts being spent

* refactor: helper to roll until an event

* chore: using latest :stable on custom and empty script docker compose

* refactor: removed unused logs

* chore: using fixed dependencies for all projects (#186)

* fix: updated balances and network name (#196)

* fix: updated throttling lib causing deploy to fail (#195)

* fix: updated firebase-admin lib version and deprecated sendMulticast (#194)

* fix: updated firebase-admin lib version and deprecated sendMulticast

* fix: tests mocking sendMulticast instead of the correct method

* fix: slow address generation (#199)

* chore: bumped to v1.6.3 (#200)

---------

Co-authored-by: Luis Helder <[email protected]>
@andreabadesso andreabadesso mentioned this pull request Dec 11, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants