Commit Graph

2908 Commits

Author SHA1 Message Date
hanako mumei d1dfa2d233 token-js: CPI Guard tests 2022-12-15 17:27:46 -08:00
hanako mumei 980065ec6c token-js: implement CPI Guard 2022-12-15 17:27:46 -08:00
dependabot[bot] d3e4ca7a6c
build(deps): bump test-case from 2.2.1 to 2.2.2 (#3917)
Bumps [test-case](https://github.com/frondeus/test-case) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v2.2.1...v2.2.2)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-16 01:00:11 +01:00
Sebastian Bor c750e03f50
Governance: v3.1 (#3915)
* Governance: Remove proposal counter (#127)

* feat: Use proposal seed instead of index

* chore: Rename and reset legacy1 to reserved1

* chore: Make Clippy happy

* chore: Fix Chat tests compilation

* Governance: Remove Realm voting proposal count (#128)

* feat: Remove Realm.voting_proposal_count

* chore: Update comments

* chore: Add tests and explicit assertions for non existing accounts

* Governance: Remove TokenOwnerRecord total_votes_count (#130)

* feat: Extend unrelinquished_votes_count to u64

* chore: Update comments and names

* chore: Update asserts

* chore: Update comments

* chore: Use u32:MAX to trim unrelinquished_votes_count

* chore: Make Clippy happy

* chore: Update versioning cleanup comments

* Governance: Active proposal count (#131)

* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* chore: Update comments

* fix: Assert new account size is greater than the existing one

* Governance: Proposal deposit (#135)

* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* feat: Add extra_lamports to create_and_serialize_account

* chore: Make Clippy happy

* feat: Implement Proposal security deposit

* chore: Make Clippy happy

* chore: Add proposal deposit amount tests

* feat: Implement RefundProposalDeposit

* chore: test_refund_proposal_deposit

* chore: Make Clippy happy

* chore: test_refund_proposal_deposit_with_cannot_refund_draft_proposal_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_record_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_error

* fix: Return deposit to deposit payer

* chore: Cleanup

* chore: test_refund_proposal_deposit_with_invalid_proposal_deposit_account_error

* fix: Remove unnecessary max(1) for account lamports

* Governance: Review feedback (#139)

* chore: Update active_proposal_count comment

* chore: Update account indices in process_create_proposal

* fix: Disallow u8::MAX for deposit_exempt_proposal_count

* chore: Use u64 without option for extra_lamports

* fix: Use explicit version 1 for TokenOwnerRecord migration

* chore: Update math for RealmConfigAccount::get_max_size

* fix: Flag ProposalCoolOffTimeNotSupported as legacy instead of reusing it

* Governance: Add proposal and payer to ProposalDeposit account (#141)

* feat: Add proposal and payer to ProposalDeposit account

* chore: Update tests

* feat: Use referential fields to check ProposalDeposit

* chore: Make Clippy happy

* chore: Update Proposal deposit amount comments

* chore: Update deposit amount comment

* chore: Update versions (#142)
2022-12-15 12:01:37 +00:00
Jordan Sexton 1f58b759d8
fix: stake-pool-js: add browser CJS build (#3910)
* fix: stake-pool-js: add browser CJS build

* update package-lock.json

* run prettier

* only emit ts declaration files
2022-12-14 19:25:46 -06:00
Jon Cinque 26aed39c54
docs: Add stake pool fees page to the sidebar (#3911) 2022-12-15 00:42:45 +01:00
Dmitri Makarov 27da0acfbe
Decrease MAX_POOL_SIZE in huge_pool test to make it work with rust 1.65 (#3909) 2022-12-14 11:53:33 -08:00
dependabot[bot] 1d6902db34
build(deps): bump bn.js from 5.2.0 to 5.2.1 in /token-swap/js (#3197)
Bumps [bn.js](https://github.com/indutny/bn.js) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/indutny/bn.js/releases)
- [Changelog](https://github.com/indutny/bn.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/indutny/bn.js/compare/v5.2.0...v5.2.1)

---
updated-dependencies:
- dependency-name: bn.js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 20:42:43 +01:00
dependabot[bot] ac96df0745
build(deps-dev): bump mocha and @types/mocha in /token/js (#3717)
Bumps [mocha](https://github.com/mochajs/mocha) and [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha). These dependencies needed to be updated together.

Updates `mocha` from 9.2.2 to 10.1.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.2.2...v10.1.0)

Updates `@types/mocha` from 9.1.1 to 10.0.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 20:26:22 +01:00
dependabot[bot] 9572d6162f
build(deps): bump certifi in /binary-option/client (#3885)
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.5.30 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2021.05.30...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 19:55:49 +01:00
dependabot[bot] e5b0ed8cf5
build(deps): bump num-traits from 0.2.14 to 0.2.15 (#3908)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.14...num-traits-0.2.15)

---
updated-dependencies:
- dependency-name: num-traits
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 19:54:46 +01:00
dependabot[bot] 56cdef9ee8
build(deps): bump certifi from 2022.6.15 to 2022.12.7 in /stake-pool/py (#3886)
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.6.15 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.06.15...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 02:42:47 +01:00
Jon Cinque 804204f505
deps: Revert uint (#3902) 2022-12-14 01:10:20 +01:00
hanako mumei 1dcdef3a01 stake-pool: allow removing validator below minimum
also minor comment errors
2022-12-13 15:22:18 -08:00
Jon Cinque ae994afa3e
Update repo to `edition = "2021"` (#3900) 2022-12-13 23:46:26 +01:00
Jon Cinque cacf4e9038
deps: Update uint to 0.9.5 (#3901) 2022-12-13 23:38:34 +01:00
dependabot[bot] 5279302b38
build(deps): bump crossbeam-utils from 0.8.5 to 0.8.11 (#3534)
Bumps [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) from 0.8.5 to 0.8.11.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.8.5...crossbeam-utils-0.8.11)

---
updated-dependencies:
- dependency-name: crossbeam-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 22:56:44 +01:00
dependabot[bot] 3372eb6c0d
build(deps): bump console from 0.14.1 to 0.15.0 (#2676)
Bumps [console](https://github.com/mitsuhiko/console) from 0.14.1 to 0.15.0.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Changelog](https://github.com/mitsuhiko/console/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/console/compare/0.14.1...v0.15.0)

---
updated-dependencies:
- dependency-name: console
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 22:54:55 +01:00
Jon Cinque 7ef7535ef2
stake-pool: Cleanup clippy, maybe fix a test (#3898)
* stake-pool: Cleanup clippy, maybe fix a test

* Change withdraw instructions more

* Refresh blockhashes
2022-12-13 16:32:52 +01:00
Jon Cinque 5f4943802b
clippy: Remove `useless_conversion` (#3899) 2022-12-13 15:56:12 +01:00
Jon Cinque 77a297c2c7
docs: Add token-2022 audits and clarify upgradability (#3894)
* docs: Add token-2022 audits and clarify upgradeability

* Update docs/src/token-2022.md

Co-authored-by: Michael Vines <mvines@gmail.com>

* Update docs/src/token-2022.md

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* More updates

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-12-13 12:26:24 +01:00
Jon Cinque 5d16d5b926 token-swap: Update withdraw-one fee calculation 2022-12-09 00:51:55 +01:00
Jon Cinque edd6a85223
ci: Update Cargo.lock with 1.4.10 crate resolution (#3883) 2022-12-09 00:21:04 +01:00
zhaogang 8922d20697
binary-option: Fixed three integer overflows (#3121)
* Fixed three integer overflows in binary-option

* Update binary-option/program/src/state.rs

Change error type to AmountOverflow.

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-12-09 00:17:55 +01:00
samkim-crypto 39a6d59f27
[token-2022] Divide encrypted fee into lo and hi (TOB-STK-11) (#3878)
* require regular fee proof for self-transfers with fee

* process encrypted lo and hi fee separately
2022-12-07 10:53:48 +09:00
Austin Adams ed8522b56e
Expose more types from CMT (#3875)
* Expose other types from CMT to allow usage on the client side while deserializing accounts.

* adds a convenient creation slot getter
2022-12-06 11:32:41 -05:00
samkim-crypto bb404a6af5
update solana to 1.14.10 (#3872) 2022-12-06 12:59:00 +09:00
Jon Cinque fd92ccf9e9
stake-pool: Keep trying to fix tests for CI (#3871) 2022-12-06 02:23:18 +01:00
Jon Cinque 56640720cf
stake-pool: Test max pool size with compute unit limit (#3870) 2022-12-05 18:47:22 +01:00
Jon Cinque da375306d2
stake-pool: Add tolerance for stake accounts at minimum (#3839)
* stake-pool: Add tolerance for stake accounts at minimum

* Use test-case to check more cases

* Add more tolerance on withdrawal

* Potentially fix test per #3854

* Keep throwing solutions until CI passes

* Fix repeated transaction issue

* Fix preferred withdrawal tolerance too

* Remove doubled tolerance
2022-12-05 12:23:36 +01:00
samkim-crypto c7fbd4b69b
check expected new source ciphertext in processing confidential transfer (#3867) 2022-12-03 14:46:02 +09:00
samkim-crypto 6a8cf4f938
[docs] Add formal spec for the public-key validity proof (#3863)
* ci: Bump rust stable version for twotx build

* [docs] add public-key validity proof formal spec

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-12-02 14:23:13 +09:00
Athar Mohammad c7c12f987c
token-cli: support for permanent delegate (#3841)
* token-cli: support for permanent delegate

* using associated account helper
2022-11-30 17:19:22 +01:00
Tyera 979fdc8b7b
Bump ATA to v1.1.2 (#3855) 2022-11-29 13:48:49 -07:00
Jon Cinque 30f60563ba
stake-pool: Make transaction signatures unique in withdraw test (#3854) 2022-11-29 20:54:46 +01:00
Jon Cinque 1566564b04
stake-pool: Refresh blockhash more often on update tests (#3853)
* stake-pool: Refresh blockhash more often on update tests

* Bump down max pool size, updated correctly in #3839

* Move withdraw test to another file

* Refactor withdraw tests more

* Get more blockhashes during `update_stake_pool_balance`
2022-11-29 19:15:46 +01:00
Jon Cinque 7d4ab6028b
stake-pool: Split up more tests to help CI, avoid warping (#3852)
* stake-pool: Split up more tests to help CI, avoid warping

* Remove unnecessary updates

* Split preferred test that keeps failing
2022-11-29 15:49:55 +01:00
Jon Cinque 792ffbc518
stake-pool: Split up tests to avoid CI failures (#3850) 2022-11-29 02:22:18 +01:00
Jon Cinque d8e3803fe4
ci: Fix 2xtx build (#3849) 2022-11-29 01:29:58 +01:00
Sebastian Bor 21cfaffc78
Governance: voting_cool_off_time (#3830)
* wip: add voting_cool_off_time

* feat: Default voting_cool_off_time to 1h for 10h or longer votes

* wip: Assert valid voting cool of time

* chore: cleanup GovernanceConfig tests

* chore: Rename vote_end_time() to expected_vote_end_time()

* chore: test_cast_council_veto_vote_within_cool_off_time

* chore: test_cast_approve_vote_with_cannot_vote_in_cool_off_time_error

* chore: test_change_yes_vote_to_no_within_cool_off_time

* chore: Reorder GovernanceConfig fields

* chore: test_finalize_vote_with_cannot_finalize_during_cool_off_time_error

* fix: Remove default voting_cool_off_time

* fix: Use max = base + cool_off voting time setup

* chore: Cleanup

* chore: Fix test_change_yes_vote_to_no_within_cool_off_time

* chore: Adjust base, cool off and max voting time names

* chore: Create has_voting_base_time_ended
2022-11-25 11:43:32 +00:00
Zhuojie Zhou | rex c24f9e876b
managed-token: add approve/revoke methods (#3820)
* managed-token: add approve/revoke/wrap methods

* Remove wrap and add more tests
2022-11-23 23:17:54 +01:00
hanako mumei 1a0e7742dc token-cli: temp add wildcard to account output 2022-11-23 10:39:28 -08:00
Athar Mohammad 3dd744d450
js support for permanent delegate authority (#3833) 2022-11-23 16:29:09 +01:00
hanako mumei 0de5f7339a bump token-cli to 2.2 and token-client to 0.3 2022-11-21 12:41:53 -08:00
Jon Cinque b253f36dd9
stake-pool: Bump token-2022 to 0.5 (#3837) 2022-11-21 20:45:52 +01:00
Jon Cinque fa438bbfa8
stake-pool: Add / remove validators from the reserve (#3714)
* stake-pool: Create validator stake accounts from reserve

* Update accounting to take minimum into account

* Refactor withdraw tests

* Add ability to remove validators during withdraw stake

* Add seed to validator stake account address derivation

* Update CLI with new instruction formats

* Update documentation and helper scripts for new funding

* Update Python bindings

* Try to fix flakey test

* Support token-2022

* Condense tests for CI

* Reduce huge pool limit post-rebase

* Avoid draining the whole reserve

* Restrict account extensions on allow-list

* Update comments to say "lamports"

* Fixup code comments and variable names

* Fix clippy in tests
2022-11-21 20:13:27 +01:00
hanako mumei 3c4267be06 token-2022: bump version to 0.5 2022-11-21 09:29:18 -08:00
Sebastian Bor dc18878ef1
Governance: Maintenance update (#3832)
* chore: Add comment to unused Governance account

* chore: fix typos

* chore: Update comments
2022-11-19 14:48:14 +00:00
Jon Cinque e0dd05fa5c
stake-pool: Add test for removing all validators from huge pool (#3806) 2022-11-19 01:47:02 +01:00
Jon Cinque 135cbdff04
stake-pool: Add lamports check for transient stake account on decrease (#3805) 2022-11-19 01:43:22 +01:00