test: Add Comprehensive Unit Tests for Mainnet-Ready Staking & Liquidity Functions#54
Open
lohit-40 wants to merge 2 commits intoStellar-Tools:mainfrom
Open
test: Add Comprehensive Unit Tests for Mainnet-Ready Staking & Liquidity Functions#54lohit-40 wants to merge 2 commits intoStellar-Tools:mainfrom
lohit-40 wants to merge 2 commits intoStellar-Tools:mainfrom
Conversation
… deterministic RPC mocking
…ng TargetChain import in agent.ts
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.
Description
This PR complements PR #53 by introducing deterministic, high-quality unit tests for the mainnet-upgraded functions in
lib/stakeF.tsandlib/contract.ts. These tests ensure the SDK correctly handles network switching and gracefully interacts with the Soroban RPC environment.Changes
tests/unit/lib/contract.test.ts(14 comprehensive test cases)tests/unit/lib/stakeF.test.ts(16 comprehensive test cases)vi.mock) to intercept@stellar/stellar-sdkRPC and transaction building..env.exampleto document the newSTELLAR_NETWORKandSOROBAN_RPC_URLvariables.Summary by cubic
Adds deterministic unit tests for
lib/stakeF.tsandlib/contract.tsto validate mainnet-ready staking and liquidity flows with mocked@stellar/stellar-sdkRPC. Updates env config for network selection and Soroban RPC, and fixes a missing type import inagent.ts.Bug Fixes
stakeF.test.tscall signatures withlib/stakeF.ts.TargetChaininagent.tsto fix type usage.Migration
STELLAR_NETWORKtotestnetormainnet(defaulttestnet).SOROBAN_RPC_URLinstead ofSRB_PROVIDER_URL(keep as legacy alias if needed).Written for commit 810d0ac. Summary will update on new commits.