Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Does anyone have successfully used Borsh::serialize()? #35

Open
mindell opened this issue Apr 8, 2022 · 4 comments
Open

Does anyone have successfully used Borsh::serialize()? #35

mindell opened this issue Apr 8, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@mindell
Copy link

mindell commented Apr 8, 2022

When i tried Borsh::serialize() i got this error..

Call to undefined method Tighten\\SolanaPhpSdk\\Borsh\\BinaryWriter::writeTighten\\SolanaPhpSdk\\Accounts\\Creator()
@neverything
Copy link
Contributor

According to the tests is seems to be working: https://github.com/tighten/solana-php-sdk/blob/main/tests/Unit/BorshTest.php

@mindell
Copy link
Author

mindell commented Apr 11, 2022

Yes, but deserializing NFT and then serializing it again is not working.
Anyway, I already use ts-node on that part.

@neverything neverything added the bug Something isn't working label Apr 22, 2022
@neverything
Copy link
Contributor

@mindell this does indeed seem like a bug currently. Feel free to write a pull request for it or I'll get to it eventually in the future.

@chongkan
Copy link

@neverything , this is NOT a bug.

The class doesn't contain the method @mindell was trying to call.

See: https://github.com/verze-app/solana-php-sdk/blob/main/src/Borsh/BinaryWriter.php

For both the serializer and deserializer to work, one needs to use a valid STRUCT and the struct needs to include the definition of any other custom structs it might be using.

See: https://github.com/verze-app/solana-php-sdk/blob/main/src/Accounts/Metadata.php

FYI, I just made a pull request. #53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants