Repository navigation
Conversation
Author
|
Reviewer note: the payroll fix in 8390132 is separate from the TL-7/TL-10 work, so it can be reviewed on its own. |
This branch has not been deployed
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.
Summary
Adds a cross-contract integration test crate (TL-7) and a Friendbot funding script with test token setup (TL-10). Writing the integration tests exposed a payroll bug on
main, which is fixed here as well because the Rust CI job cannot pass without it.Fix: payroll stream on
mainmaincurrently failscargo test --all. The merge in 4535c5d leftpayroll_stream/src/test.rswith duplicate helper functions, duplicatecreate_streamcalls and references to undefined variables, so the crate does not compile its tests. The same merge also duplicated two token transfers inpayroll_stream/src/lib.rs:create_stream2 * total_amountfrom the sender after checking onlytotal_amounttotal_amountonceclaim2 * claimableclaimableonceI removed the duplicated transfers and the leftover merge lines in
test.rs. No test was dropped; all 22 payroll tests run and pass. The regenerated payroll snapshots reflect the single transfer.Fix: build on current stable Rust
CI installs the latest stable toolchain (rustc 1.100.0), and
ethnum 1.5.2, whichsoroban-sdkpulls in, no longer compiles there (E0512: cannot transmute between types of different sizes). This breaks every Rust and Docs job.Cargo.locknow pinsethnum 1.5.3, which builds. I reproduced the failure and the fix locally on 1.100.0.TL-7:
contracts/integration_testsNew workspace member with only a
tests/target, so it adds nothing to the release or wasm builds. Each test registers the real treasury, governance, payroll stream and vesting contracts plus a Stellar Asset Contract token in oneEnv. No contract is mocked.To reach the shared types from outside their crates,
errorsandtypesare nowpub modin each contract'slib.rs.approved_proposal_is_disbursed_by_treasury_multisigrejected_proposal_cannot_be_executed_and_funds_stay_in_treasurytreasury_budget_funds_payroll_stream_claimed_by_employeeCompletedwith the payroll contract emptytreasury_budget_funds_vesting_schedule_claimed_by_beneficiarymultiple_users_share_payroll_and_vesting_without_leaking_fundsThe treasury
depositentrypoint in the workspace contract does not transfer tokens yet, so the tests fund the vault with a direct token transfer. With the duplicate transfers put back, the payroll and multi-user tests fail.TL-10:
scripts/fund-testnet.shhttps://friendbot.stellar.organd prints the funding transaction hash. Accounts that already hold the starting balance are skipped.--token, the first account issues the asset. The script deploys its Stellar Asset Contract (or reuses the existing one), adds trustlines on the other accounts and mints--amountto each of them.scripts/deploy.sh. Usage is documented in a new "Testnet Setup" section inCONTRIBUTING.md.The TL-7 and TL-10 boxes in
docs/ISSUES-SDK-TOOLING.mdare checked.Testing
All of the above pass on rustc 1.96.0 and 1.100.0.
I ran the faucet script end to end against testnet:
GDQ3XX7SWE26LNWKDDLZRP6ZJ5WLR547WDI6C5RJCN7QMIA7PASTIF33(txcb5c81efe6bce178e845191d3d8e142ffbd46fbb16acdf511eed5e17cf906787),GB5U43HH7E4N5FWGVK5RHR7YIOSD5JP535WWH4T2SYIDAF2EJW66XBRQ(txbae2ec9598479826075cc2d712b438cfc357b17a80371f485079e5067237a7f5) andGCGJCZKNUSY2VMIGQOVHB6XNEOQA5DXHNTUW4X554XOJ6D4QUQXRTYKC(tx1da5c63f23853dce931c3020a73c3e5858ebac95057a9dbb209db2ca105a1860)CBTC4VANAMZP3UBTDSELYVK7MHB3E6NSVZOUGPJJROK3YFNP2DL7RF47and minted to both non-issuer accounts (txea47f9fa07776a495d3fe6900a643be0a36a774f569cc95c6a51334f5b67709f,317b2252ccb45c775f06ff4081987435cab6b6446ebd35e4db89a187c825efb5)I also checked the payroll fix on testnet with that token. I deployed
payroll_streamatCBVI6JGB3TGIYJODSA63NEATD3J3OJFDJJGCPDMTM5OPRIXX5UWHIEUJand streamed 6000 to the employee.create_streamtook exactly 6000 from the employer (txbb409a44d61a774c810b1588bb74d07cbabef55f614f16c41f5b36c52d3831e2). After the stream ended,claimpaid exactly 6000 and left the contract at 0 (txf8b8758365462e54385b4058c40d7523bef97f9febc079b505d2574c1664824a).One thing outside this PR: on Rust 1.96, testnet rejects a
wasm32-unknown-unknownbuild at upload withError(WasmVm, InvalidAction). That is the targetscripts/deploy.shuses. For the deploy above I built withstellar contract build, which targetswasm32v1-none. I can open a separate issue fordeploy.shif you'd like.Closes #69
Closes #72