[fix] Try deser with Base64 first #182
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
sui-sdk-types::UserSignature cannot deserialize from base64 string format, breaking compatibility with Sui's GenericSignature format https://github.com/MystenLabs/sui/blob/main/crates/sui-types/src/signature.rs#L304
e.g. client sends
{
"user": "0x123",
"signature": "ANp47jDZQszLl6ocHM..." // base64 encoded user sig
}
without the fix deser fails - UserSignature only accepts structured json like:
{
"signature": {
"scheme": "ed25519",
"signature": "2njuMNlCzMuXqhwcz9...",
"public_key": "DX2rNYyNrapO+gBJp..."
}
}
this change fixes it by accept both formats using an untagged enum, test added! (otherwise i had to implement a workaround: https://github.com/MystenLabs/seal/pull/412/changes#diff-7e3a1314e53d356a05b0214b65850dd9de61b41131fc5d4e3076fed0c3d450d4R55)