Commit Graph

2556 Commits

Author SHA1 Message Date
Alexander Meißner fe2e5b6d2b
Adds "solana-version" to "patch.crates-io.sh" (#2603)
To fix broken "downstream-projects" CI step in the mono repo after #2576 was merged.
2021-11-30 16:04:05 +01:00
Alexey Skibin 05c26de4c8
Add Solana Farms (#2576) 2021-11-29 11:37:23 -06:00
Victor Pontis 801b4e59f8 Update comment on state.rs regarding is_native
I was confused when reading this comment and had to read the code to realize that the comment isn't a typo. 

(Btw, let me know if this kind of small changes are helpful or not 👍.)
2021-11-28 20:39:45 -08:00
Paul 7393f1de43
spl-token: provide more useful output when using create-token with the output option and small redesign of token cli architecture (#2593)
* spl-token: WIP

* Remove and_then, move tx handling in separate function- output handling still missing

* spl-token: add basic output handling for all calls, add detailed output to create-token

* spl-token: remove changes in bench that are not strictly necessary to remove # of files touched in this PR

* [spl-token] cli: HandleTxReturn is now TransactionReturnData

* [spl-token] cli: Make commands return output String that is printed in fn main()

* [spl-token] cli: remove old todos

* [spl-token] cli: only use no_wait arg in command_transfer and use constant for "create-token"
2021-11-24 12:08:46 -07:00
Jon Cinque f83240a868
token-swap: Prevent single deposits for curves that don't allow it (#2590) 2021-11-17 23:41:55 +01:00
Jon Cinque d5581dbd62
governance: Remove dependency on ProcessInstructionWithContext (#2589) 2021-11-17 15:48:01 +01:00
Jon Cinque 7764a9d5c7
token: Transition perf-monitor to solana-program-test (#2586)
* token: Transition perf-monitor to solana-program-test

* fmt

* Refactor for clarity
2021-11-16 23:15:45 +01:00
Jon Cinque 688ee423ed
stake-pool-cli: Fix vote account address in details (#2585) 2021-11-16 21:30:10 +01:00
Michael Vines 4a9c91d594 Bump spl-name-service version to 0.2.0 2021-11-16 08:55:46 -08:00
DR497 fb949741fb name service: allow parent name owner to update records 2021-11-16 08:41:11 -08:00
Jon Cinque 02d2736797
token-js: Add test for disabling mint authority (#2582) 2021-11-15 18:56:23 +01:00
Dmitri Makarov c6758a697c
Increase compute max units for sqrt_u128_max test (#2574)
This increase is caused by upgrade of compiler builtins
2021-11-13 07:16:11 -08:00
Sebastian Bor bf7ad18f41
Governance: vote options (#2544)
* feat: use VoteChoice instead of VoteWeight

* chore: make clippy happy

* feat: use options for ye/no vote

* feat: use choices for CastVote instruction

* chore: move Vote enum to tests

* fix: iterate overall choices for withdrawal

* chore: split ProposalOption and ProposalOptionVote

* fix: calculate multi option proposal size

* chore: split weighted and fractional vote choices

* feat: add proposal type

* feat: add reject option flag

* feat: calculate final state for proposal using options results

* chore: make clippy happy

* fix: generalise max vote weight calculation for multiple options

* feat: gate vote tipping for yes/no proposals only

* chore: make clippy happy

* feat: add option_index to instruction

* feat: move instructions to options

* chore: advance clock

* chore: add await

* chore: add multi option proposal tests

* chore: move governing_mint to account list

* feat: assert valid proposal options

* feat: assert proposal is executable when instruction is added

* chore: make clippy happy

* chore: add tests to insert instructions into multi option proposal

* chore: make clippy happy

* feat: use explicit reject_option_vote_weight

* feat: use Vote struct for vote results

* feat: validate vote

* feat: reject empty proposal options

* chore: update comments

* fix: allow execute only successful options

* chore: add assertions for option statuses

* chore: add partial success test

* chore: add full success execution test

* chore: add test for instructions execution for fully denied proposal

* feat: finalise none executable proposals into completed state

* chore: fix chat

* feat: add vote_record v1 v2 roundtrip serialization

* eat: add proposal_instruction v1 v2 roundtrip serialisation

* chore: use VoteRecordV1

* chore: use legacy structs instead of legacy crate version

* chore: rename proposal to V2

* feat: translate Proposal v1 v2 versions

* chore: make clippy happy

* chore: make clippy happy

* chore: remove unnecessary clone for match

* chore: rename get_final_vote_state to resolve_final_vote_state

* fix proposal account name

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

* chore: fix compilation

* chore: use borsh::maybestd::io::Write

* chore: consume self in serialise instructions to avoid cloning

* chore: update comments

* feat: add N limit placeholder to multi choice vote type

* feat: increase options size to u16

* fix: use checked math

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-11 19:34:00 +00:00
JulI0-concerto cd63580b79
Implement multiple output format for spl-stake-pool list-all (#2558)
* Implement json output formats for spl-stake-pool list-all

* Implement --output json or json-compact or display in list-all cmd

* cleanup: use destructuring instead of tuple

* Fix related to PR comments

* Add json and json-compact output for list command

* implement list command display with Display and VerboseDisplay

* make CliStakePool->details optional

* cleanup use

* Update stake-pool/cli/src/main.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update stake-pool/cli/src/main.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* clippished

* fix use

* fix fmt issue

Co-authored-by: Julien Piccaluga <julien.piccaluga@kudelskisecurity.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-10 13:06:14 -07:00
Ikko Ashimine 707382ee96
Fix typo in main.rs (#2569)
auxillary -> auxiliary
2021-11-10 11:18:07 -07:00
Jon Cinque 75ddd9bb22
stake-pool-docs: Rearrange docs, add quickstart guide (#2561)
* stake-pool-docs: Rearrange docs, add quickstart guide

* Rearrange doc sidebar
2021-11-06 12:48:11 +00:00
MarkSackerberg 81c90f5c73
Allow GC to close empty associated accounts (#2554)
* Allow GC to close empty associated accounts

Empty associated accounts will only be closed in case the new flag del_associated_accounts is set. Otherwise behaviour is as before.

Useage:
spl-token gc --del_associated_accounts

* use kebab-case

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

* align coding style

Thank you jon!

* Add sanity check

* correcting amount check before closing

* formatting correcly

using cargo fmt

* changing sanity check to assert!

Co-authored-by: Sack <none>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
Co-authored-by: Mark Sackerberg <Contact@Discord>
2021-11-04 22:49:23 +01:00
Jon Cinque fcbc0d3501
token-swap: Add comment for stable curve A calculation (#2556) 2021-11-03 19:48:25 +01:00
Jon Cinque 8aef395901
stake-pool: Bump CLI and program version to 0.6.3 (#2555) 2021-11-02 22:15:33 +01:00
Jon Cinque 01765b9953
stake-pool: Reduce wait for active stake merges (#2553)
* stake-pool: Reduce wait to one epoch for active merges

* Remove stake_program references

* Remove credits observed point from docs
2021-11-01 15:14:49 +01:00
Alexander Ray 287c3bedaf
stake-pool-cli: Fix prepare_withdraw_accounts issues (#2548)
* - fix prepare_withdraw_accounts issues

* - use reverse fee as workaround for withdraw issue
2021-10-26 23:13:59 +02:00
Jon Cinque cd3f5ae9fe
stake-pool: Add test for withdrawing all, with fee (#2550) 2021-10-26 22:50:16 +02:00
Jon Cinque 8be3ba819c
stake-pool-docs: Add the published audits (#2546) 2021-10-26 22:30:16 +02:00
Jon Cinque 756696ee8e
stake-pool-cli: Add validator list argument to create (#2545)
People want to know more about the validator list, but there isn't too
much info provided.

* Include the validator list as an optional parameter to pool creation
* Print out the address during creation
* Always print out the address during `list`
* Add docs about it
2021-10-25 23:13:58 +02:00
Sebastian Bor d550f4f7e6
Governance: Flag payer account as writable on instructions creators (#2543) 2021-10-25 14:08:34 +01:00
Michael Vines fca9836a2c Avoid MemcmpEncodedBytes::Binary 2021-10-20 22:52:19 -07:00
Michael Vines e2a5785ad7 Revert "Revert once SPL updates to Solana 1.8.1"
This reverts commit f5767bb3e209b591c657ad5732ff854c635292a4.
2021-10-20 22:52:19 -07:00
Michael Vines 9acb082dc3 Upgrade to Solana v1.8.1 2021-10-20 22:52:19 -07:00
Jarry Xiao c8963e8348
Updating Stateless Offer to Optionally Include Fees (#2507)
* Updating Stateless Offer PDA seeds to only require main wallet and mint types

* Added optional payment of creator fees for NFTs

* Addressed formatting issues

* Fixed bugs in fee paying code, removed logs to lower compute limit

* Add in check to make sure the proper metadata is passed in

* Added workflow for taker posting NFT (maker pays fees)
2021-10-20 19:51:38 -05:00
Sebastian Bor ef72e56738
Governance: Use max_voting_time to determine proposal final state (#2529)
* feat: do not allow withdrawing votes before proposal is finalised

* feat: do not allow proposal cancellation before proposal is finalised

* chore: update comments and add test

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-20 20:48:02 +01:00
Jon Cinque 4ab60e6794
stake-pool: Also set the sol deposit authority on init (#2532) 2021-10-20 01:45:00 +02:00
Jon Cinque 675d65b965
stake-pool-cli: Add more docs around scripts (#2531) 2021-10-20 01:29:00 +02:00
Jon Cinque 203db7bc3f
stake-pool-cli: Improve deposit and withdraw UX (#2530) 2021-10-19 23:30:41 +02:00
Michael Vines c9a918f5cd Avoid `Hash`'s private parts, use `AsRef` instead 2021-10-19 09:11:56 -07:00
Jon Cinque c5e7ae736e
stake-pool: Add comment to validator stake info field (#2527) 2021-10-19 17:19:10 +02:00
Jon Cinque 1a48523a80
stake-pool: Remove copied stake program code (mostly) (#2526)
* stake-pool: Remove (mostly) the copied stake program

* Remove references to stake_program in CLI
2021-10-19 16:48:56 +02:00
Sebastian Bor d6d0b92ae7
Governance: Voter-weight-addin cleanup (#2512)
* chore: Ensure voter-weight-addin is built for tests

fix: build addin during test run

fix: build voter weight addin for tests using the addin only

chore: use mutex to build addin only once

chore: move build guard to separate file

chore: update governance version for chat

* chore: create tools crate for common utility functions in governance ecosystem

* chore: add test-sdk and tools readme

* chore: rename reserved addins to specific names

* chore: remove todo comment

* chore: remove unnecessary var drop

* chore: move all account tools to shared crate

* chore: fix chat compilation

* chore: move program_id to first position
2021-10-19 11:43:01 +01:00
Jon Cinque f95e390dd4
stake-pool: Clarify stake deposit fee (#2520) 2021-10-19 12:26:50 +02:00
Colin Ogoo 0a5e952485 fix: typo in comments
fix minimal typo in comment
2021-10-18 19:02:46 -06:00
Jon Cinque 3b48fa09d3
stake-pool: Cleanup documentation in code (#2525) 2021-10-19 01:50:35 +02:00
Jon Cinque 4658815e9f
stake-pool: Force pools to only use the SPL token program (#2521) 2021-10-19 01:39:57 +02:00
Jon Cinque 7f0278caa8
stake-pool: Add checked math to big vec calc (#2524) 2021-10-19 00:46:49 +02:00
Jon Cinque f97c61a9ed
stake-pool: Initialize all pool fields explicitly (#2523) 2021-10-19 00:46:39 +02:00
Jon Cinque 50b5597fcf
stake-pool: Improve error when overdrawing on decrease (#2522) 2021-10-19 00:45:46 +02:00
Alexander Ray 671590dd05
- reimplement prepare_withdraw_accounts according to the documentation (#2513)
* - reimplement prepare_withdraw_accounts according to the docu

* - add preferred withdraw validator

* - fix clippy issues

* - fix styling
2021-10-15 22:35:44 +02:00
Sebastian Bor e8b7009cc4
Governance: Add UI section to readme (#2511) 2021-10-13 21:38:04 +01:00
Michael Vines 647129c612 Revert once SPL updates to Solana 1.8.1 2021-10-13 12:45:21 -07:00
Michael Vines 18543cf352 Adapt to retyping of HEAP_START_ADDRESS from usize to u64 2021-10-13 12:45:21 -07:00
Sebastian Bor dc7f6be034
Governance: Add deposit amount (#2485)
* feat: add amount to Deposit instruction

* feat: use try_from_slice_unchecked to support forward compatibility

* chore: make clippy happy

* chore: update comments
2021-10-13 19:59:30 +01:00
fukaoi 5436ac239e
added transferChecked (#2481) 2021-10-13 16:55:19 +02:00