-
Notifications
You must be signed in to change notification settings - Fork 891
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
Update dApp to work with the single-asset balance model. #80
Conversation
We have to drop sandbox mode, because we need classic Stellar operations. The sandbox RPC server (i.e. `soroban serve`) does not support anything but the Soroban-only `invokeHostFunction` operation. We'd need to simulate trustlines in the sandbox if we want this mode available to the example dApp.
@@ -51,7 +51,7 @@ const Pledge: FunctionComponent = () => { | |||
const tokenName = | |||
token.name.result && convert.scvalToString(token.name.result) | |||
const tokenSymbol = | |||
token.symbol.result && convert.scvalToString(token.symbol.result) | |||
token.symbol.result && convert.scvalToString(token.symbol.result)?.replace("\u0000", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment on why the "\u0000"
thing is needed, please?
cc @sisuresh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this is necessary. It looks like the symbol is "symbol", and ScSymbol
allows 10 chars, so maybe something is filling out the last four chars and this just strips that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The symbol is an asset4 code; those get padded with null bytes, right? I think that's why this is there, but I need to root-cause where it comes from.
throw new Error(`Expected exactly one result, got ${response.results}.`); | ||
} | ||
|
||
return SorobanClient.xdr.ScVal.fromXDR(Buffer.from(results[0].xdr, 'base64')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is moving to @soroban-react/contract in #79, but let's do this here first, and move it over after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @esteblock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will wait this to be finished and I'll include it.
The |
8077f5e
to
47c382a
Compare
Even without this, `deposit` should still fail on the `xfer_from`, so it shouldn't be an issue.
6a1a766
to
c05fddf
Compare
Closes #76.