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: patching algosdkv3 compatibility issues #53

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev commented Jan 3, 2025

Fixes - #52, #51

Proposed changes

  • Migrating to algosdk v3
  • Reusing simulate response parser from avm-debugger package to handle both v3 and v2 algosdk based simulate response objects

Tested against simulate traces from v6 utils + v2 algosdk and v8 utils + v3 algosdk (as per bug descriptions in issues above)

@aorumbayev aorumbayev marked this pull request as ready for review January 3, 2025 20:12
src/utils.ts Outdated
function parseAlgosdkV2SimulateResponse(obj: any): any {
if (obj === null || typeof obj !== 'object') return obj

const addressFields = new Set(['snd', 'close', 'aclose', 'rekey', 'rcv', 'arcv', 'fadd', 'asnd'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are a couple of other fields like 'm', 'r', 'f', 'c'. Maintenance of this code isn't going to be great, for example we'll need to add block proposer "prp". I don't have any other great options though and we are doing similar things in multiple repos algorandfoundation/algokit-subscriber-ts#102 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@neilcampbell pushed a commit adding extra fields, incluing the 'prp'

@aorumbayev aorumbayev merged commit dd2a9f6 into main Jan 6, 2025
3 checks passed
@aorumbayev aorumbayev deleted the fix/algosdkv3 branch January 6, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants