-
Notifications
You must be signed in to change notification settings - Fork 137
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
Support constructors in contract creation via Operation.createCustomContract
#770
Conversation
Size Change: +2.31 kB (+0.07%) Total Size: 3.26 MB
|
Why |
@chadoh will you accept "laziness" as an answer? 😆 fixed! |
4e30bde
to
b368f81
Compare
Operation.createCustomContract
0bea18a
to
5e2b7d4
Compare
@@ -91,7 +91,12 @@ export const AuthClawbackEnabledFlag = 1 << 3; | |||
* * `{@link Operation.setTrustLineFlags}` | |||
* * `{@link Operation.liquidityPoolDeposit}` | |||
* * `{@link Operation.liquidityPoolWithdraw}` | |||
* * `{@link Operation.invokeHostFunction}` | |||
* * `{@link Operation.invokeHostFunction}`, which has the following additional |
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.
👍
// note: using a string here doesn't work because once the operation | ||
// is encoded/decoded it will be a Buffer internally and it'd be a | ||
// mild pain in the ass to check equivalence | ||
nativeToScVal(Buffer.from('admin name')), |
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.
understood, but, it may be worthwhile to demonstrate plain string usage here as it represents typical client code scenario(and test is used as a reference by devs and followed verbatim), and then add the clunky buffer conversion down later for just test assertion purposes.
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.
fair enough :) way to advocate for the user 😎 done in 8450ac2!
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.
really clean integration and test coverage!
* Add TypeScript definitions * Make code fmt action separate from tests
Upgrade the
createCustomContract
abstraction to accept a new, optional parameter:class Operation { // ... createCustomContract( address: Address, wasmHash: Buffer | Uint8Array, + constructorArgs?: xdr.ScVal[], salt?: Buffer | Uint8Array, ...
and upgrade the internals to use the
CreateContractV2
host function.This closes #768.