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

Disagreement between TransactionReceipt serialization in Swift SDK and JS SDK #267

Open
izik1 opened this issue Aug 29, 2023 · 3 comments
Open

Comments

@izik1
Copy link
Contributor

izik1 commented Aug 29, 2023

I got a base64Encoded string of TransactionReceipt generated by Hedera JS SDK, when I try to parse it using Swift SDK it is showing below error.
Unexpected missing account

Here is my code sample

func getTransactionReceipt() {
        do {
            let base64Encoded = "EhwIFioSChAIsOoBEOudChoGCJDEsacGOABCAFgA"
            let data = Data(base64Encoded: base64Encoded)!
            let receipt = try TransactionReceipt.fromBytes(data)
            print("TransactionReceipt \(receipt)")
        } catch {
            print("Error \(error.localizedDescription)")
        }
    }

Originally posted by @nirmalpatidar123 in #259 (comment)

@izik1
Copy link
Contributor Author

izik1 commented Aug 29, 2023

This isn't a bug so much as "what do we do here", so... @SimiHunjan:
As I see it there's 3 options here:

  1. Do nothing (keep the current serialization, as consistent with Java)
  2. Switch to be consistent with JS/Go (and switch Rust too... But now we're not consistent with Java)
  3. SupportfromBytes for either form and emit one of the two above.

@nirmalpatidar123
Copy link

Hi @izik1 @SimiHunjan ,

I'm trying out Wallet Connect for Hedera Network. the Dapp requesting for TransactionReceipt query to Hedera Wallet which may be build on Java or Swift SDK and Dapp preparing query and transaction using Hedera JS SDK so it would be helpful if the serialization support cross platform.

Thanks

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

No branches or pull requests

2 participants