Skip to content

fix: io decoded handling #229

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

Merged
merged 3 commits into from
Apr 2, 2025
Merged

fix: io decoded handling #229

merged 3 commits into from
Apr 2, 2025

Conversation

andreabadesso
Copy link
Collaborator

@andreabadesso andreabadesso commented Apr 2, 2025

Motivation

After HathorNetwork/hathor-core#1250, the decoded key of output and spent_output (inputs) is now returning an empty object when the script is unable to be parsed, causing our code to fail because we were expecting it to be null.

Acceptance Criteria

  • We should properly handle empty objects in decoded
  • We should have a mechanism for checking if all required keys are available in the decoded object.

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
  • [X ] 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/io-decoded-handling branch from 3005ca9 to f197193 Compare April 2, 2025 13:59
@andreabadesso andreabadesso self-assigned this Apr 2, 2025
@andreabadesso andreabadesso added the bug Something isn't working label Apr 2, 2025
@andreabadesso andreabadesso moved this from Todo to In Progress (Done) in Hathor Network Apr 2, 2025
r4mmer
r4mmer previously approved these changes Apr 2, 2025
pedroferreira1
pedroferreira1 previously approved these changes Apr 2, 2025
@@ -238,7 +239,7 @@ export const handleVertexAccepted = async (context: Context, _event: Event) => {
const blockRewardOutput = outputs[0];

// add miner to the miners table
if (blockRewardOutput.decoded) {
if (isDecodedValid(blockRewardOutput.decoded)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decoded.address is required here, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks

@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Apr 2, 2025
@andreabadesso andreabadesso dismissed stale reviews from pedroferreira1 and r4mmer via b9af726 April 2, 2025 15:19
@pedroferreira1 pedroferreira1 moved this from In Review (WIP) to In Review (Done) in Hathor Network Apr 2, 2025
@andreabadesso andreabadesso merged commit 682c8da into master Apr 2, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Apr 2, 2025
@andreabadesso andreabadesso deleted the fix/io-decoded-handling branch April 2, 2025 15:30
r4mmer added a commit that referenced this pull request Apr 2, 2025
…-lib-v2.1.1

* origin/master:
  fix: io decoded handling (#229)
  chore: bump version v1.8.0 (#226)
  fix: nft utils should be imported from common index (#223)
  fix: daemon was always using ssl regardless of config (#224)
@r4mmer r4mmer moved this from Waiting to be deployed to Done in Hathor Network Apr 2, 2025
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