Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Fix deserialize-custom-data-frontend #347

Merged

Conversation

EmekaManuel
Copy link
Contributor

fix: replace deprecated findProgramAddress with findProgramAddressSync
refactor: improve error handling and logging in Movie deserialization

Problem

  • The method 'web3.PublicKey.findProgramAddress' is deprecated and may lead to compatibility issues.
  • Insufficient error handling and logging during movie deserialization made debugging difficult.

Summary of Changes

  • Replaced the deprecated findProgramAddress method with the recommended findProgramAddressSync method for more reliable and up-to-date usage.
  • Added detailed logging for buffer length and raw buffer data in hexadecimal format to aid in troubleshooting.
  • Switched from console.log to console.error for better clarity and appropriate error handling.

Onyewuchi Emeka added 3 commits August 25, 2024 13:24
…ressSync

The signature '(seeds: (Buffer | Uint8Array)[], programId: PublicKey): Promise<[PublicKey, number]>' of 'web3.PublicKey.findProgramAddress' is deprecated.

Updated the code to use the recommended 'findProgramAddressSync' method for better compatibility.
…ressSync

The signature '(seeds: (Buffer | Uint8Array)[], programId: PublicKey): Promise<[PublicKey, number]>' of 'web3.PublicKey.findProgramAddress' is deprecated.

Updated the code to use the recommended 'findProgramAddressSync' method for better compatibility.
Enhanced the deserialization error handling by adding detailed logging:
- Log buffer length and raw buffer data in hexadecimal format for better debugging.
- Switched to console.error for more appropriate error logging.
@mikemaccana mikemaccana changed the title Fix/deserialize-custom-data-Frontend Fix paging-ordering-filtering-data-frontend.md Aug 26, 2024
@mikemaccana mikemaccana changed the title Fix paging-ordering-filtering-data-frontend.md Fix deserialize-custom-data-frontend Aug 26, 2024
Copy link
Contributor

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Same feedback as #346, can you also please ensure the screenshots are updated to show your new program?

You will also need to update https://github.com/Unboxed-Software repos mentioned in this article (or if you have replaced these repos, update the URLs). This is mentioned on the Superteam Earn bounty.

One these are fixed this should be a good candidate to go in.

…@solana/web3.js instead of importing the entire package.

- Applied linting to maintain code consistency and clarity.
- Replaced abbreviations like e with error  with more descriptive variable names for better code readability.
@EmekaManuel
Copy link
Contributor Author

i have made the necessary changes which include:

  • Replaced abbreviations like e with error with more descriptive variable names for better code readability.
  • Improved efficiency by importing specific modules from @solana/web3.js instead of importing the entire package.
  • Applied linting to maintain code consistency and clarity.

@EmekaManuel
Copy link
Contributor Author

once i rebuild the new application using create-solana-dapp, I'd update the unboxed repo links and include screenshots.

Copy link
Contributor

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Waiting for create-solana-dapp and screenshots as previously mentioned.

@EmekaManuel
Copy link
Contributor Author

EmekaManuel commented Sep 6, 2024

Waiting for create-solana-dapp and screenshots as previously mentioned.

I have implemented these, kindly check this commit - afd318d

Screenshot 2024-09-06 at 09 19 24

Copy link
Contributor

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Thanks @EmekaManuel ! Marking this as the winner for deserialize-custom-data-frontend. 🏆

@mikemaccana mikemaccana merged commit 73caf29 into solana-foundation:main Sep 11, 2024
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants