Skip to content

test: add zero cliff period tests for forge-vesting — closes #80#346

Open
spiffamani wants to merge 1 commit intoAustinaminu2:mainfrom
spiffamani:test/zero-cliff-period-issue-80
Open

test: add zero cliff period tests for forge-vesting — closes #80#346
spiffamani wants to merge 1 commit intoAustinaminu2:mainfrom
spiffamani:test/zero-cliff-period-issue-80

Conversation

@spiffamani
Copy link
Copy Markdown

Summary

Adds tests for forge-vesting with cliff_seconds = 0, closing issue #80.

Changes

  • Fixed setup_with_token() to correctly extract Address from StellarAssetContract
  • Fixed balance checks to use token::Client instead of StellarAssetClient
  • Fixed pre-existing cancel tests to use setup_with_token() for real token transfers
  • Added 6 zero cliff period tests

Zero Cliff Tests Added

  • test_zero_cliff_initialize_succeeds — cliff=0 is valid config
  • test_zero_cliff_claim_succeeds_immediately — claim works after 100s with no cliff
  • test_zero_cliff_correct_vested_amount_at_halfway — 500_000 vested at t=500
  • test_zero_cliff_fully_vested_after_duration — fully vested at t=2000
  • test_zero_cliff_claim_immediately_after_initialize — NothingToClaim at t=0
  • test_zero_cliff_vesting_starts_immediately — 1_000 vested at t=1

Test Results

test result: ok. 19 passed; 0 failed; 0 ignored

Checklist

  • cargo test -p forge-vesting — 19/19 passing
  • No unsafe code
  • No new dependencies

…nu2#80)

- Fix setup_with_token() to use stellar_asset.address() correctly
- Fix balance checks to use token::Client instead of StellarAssetClient
- Fix cancel tests to use setup_with_token() for real token transfers
- Add 6 zero cliff tests:
  - test_zero_cliff_initialize_succeeds
  - test_zero_cliff_claim_succeeds_immediately
  - test_zero_cliff_correct_vested_amount_at_halfway
  - test_zero_cliff_fully_vested_after_duration
  - test_zero_cliff_claim_immediately_after_initialize
  - test_zero_cliff_vesting_starts_immediately
@spiffamani
Copy link
Copy Markdown
Author

please check and merge my job all my test passed, base on the job you recomended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant