feat(sdk-node): auto-airdrop configured addresses in the kit plugin - #754
Open
amilz wants to merge 3 commits into
Open
feat(sdk-node): auto-airdrop configured addresses in the kit plugin#754amilz wants to merge 3 commits into
amilz wants to merge 3 commits into
Conversation
In attach mode the client must already carry a `payer`, and that signer is typically unfunded on the running Surfnet, so every caller had to make a separate cheatcode call before sending a transaction. `surfpool()` now accepts `airdropAddresses` (addresses or signers) and an optional `airdropAmount`, funding each entry while the client is composed.
Contributor
Greptile SummaryThe PR adds optional startup funding for configured addresses in embedded and attach modes.
Confidence Score: 4/5The implementation appears functionally sound, but the unsigned commits must be replaced with signed, verified commits before merging. The previously reported amount-validation failures are fixed, but every commit in the reviewed range lacks the verified signature required by the repository. Important Files Changed
Reviews (3): Last reviewed commit: "fix(sdk-node): reject negative airdropAm..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In attach mode the kit client must already carry a
payer, and that signer is typically unfunded on the running Surfnet — so every caller had to make a separate cheatcode call before they could send anything.surfpool()now takesairdropAddresses(bare addresses or anything carrying one, e.g. signers) plus an optionalairdropAmount, funding each entry while the client is composed:Decisions worth flagging:
setAccountcheatcode, notclient.airdrop. The faucet path confirms over WebSocket, and the attach-mode WS URL is a derived guess (the port-8900 heuristic). Tying client construction to that heuristic being right is the wrong trade; the cheatcode needs HTTP only.airdropAmountis skipped, and only the lamport balance is written, so existing data and owner survive. Idempotent, and never lowers a balance that a runbook already set.airdrop_lamportsdefault.cause— silent under-funding would resurface later as a confusing transaction failure..use()callers keep working. The sync overload rejects a possibly-presentairdropAddresses({ airdropAddresses?: never }); without that, a conditional value would type as sync while dispatching async, handing back a Promise typed as a client.Works in embedded mode too, alongside the pre-funded payer.
--
One thing that I have mixed feelings about @MicaiahReid ...
client.payer.address. I think this would make sense but maybe could be annoying for folks that don't want it funded for some reason? idk.--
Closes TOO-650