Commit Graph

79 Commits

Author SHA1 Message Date
Jon Cinque 182c0532e4
associated-token-account: Add recover nested account ix (#2889)
* associated-token-account: Add transfer / close nested accounts

* Swap wallet and wrong_wallet in test

* Use new error

* Force destination to wallet and ATA

* Fix merge conflicts

* Add more vanilla spl-token tests

* Improve test, fix instruction comments

* Address feedback

* Rename CloseNested -> RecoverNested, add comment

* Fix typo in comment
2022-03-22 22:58:10 +01:00
Tyera Eulberg f4c5fdcfcf
Bump solana to v1.9.9 (#2902) 2022-02-23 16:20:55 -07:00
Jon Cinque 20864c0be7
token: Support both token programs in associated-token-account (#2904)
* token: Support both token programs in associated-token-account

* Rename spl-token -> spl-token-2022, spl-token-legacy -> spl-token

* Use spl-token by default

* Check mint in get_account_data_len

* Add checks for either token program

* Rebase fix

* Update version comments in tests
2022-02-15 14:20:14 +01:00
Jon Cinque 89aa9475ba
associated-token-account: Fail idempotent for non-ata (#2903) 2022-02-11 23:44:41 +01:00
Michael Vines 1b369e1cf7 Bump spl-token-2022 version to 0.2.0 2022-02-10 16:03:45 -08:00
Jon Cinque 290d8d880a
associated-token-account: Add "CreateIdempotent" instruction (#2883)
* associated-token-account: Add "CreateIfNonExistent" instruction

* Address feedback

* Move ownership check
2022-02-10 00:35:46 +01:00
Tyera Eulberg 428d93bdcb
Move program-2022 tests to new crate (#2892) 2022-02-09 15:02:33 -07:00
Tyera Eulberg c7ec4427b6
token-2022: Add Reallocate instruction (#2864)
* Pass by ref

* Dedupe ExtensionTypes in length apis

* Depend on deduplication in ExtensionType::get_account_len

* Add Reallocate instruction

* Remove unneeded api

* Add set_account_type helper and remove unneeded StateWithExtensionsMut api
2022-02-04 15:23:16 -07:00
Michael Vines 115c3c4703 Add ImmutableOwner extension to block ATA owner authority changes 2022-02-01 12:53:45 -08:00
Michael Vines 809c1a1a77 GetAccountDataSize instruction now accepts user-provided extension types 2022-01-31 23:03:22 -08:00
Tyera Eulberg 5b0e0c12e6
Single use stmts (#2850) 2022-01-31 15:04:47 -07:00
Tyera Eulberg eaaed0d3c4
Handle extended token Accounts in ATA program (#2738)
* Use token-2022 in ProgramTest

* Add get_account_len() helper with CPI to spl_token::get_account_data_size()

* Add test for extended mints/accounts using transfer_fee
2022-01-28 15:40:39 -07:00
Tyera Eulberg 9d759b70f9
Revert "Revert ATA to spl-token v3.3 (#2796)" (#2800)
This reverts commit 533f767563.
2022-01-28 12:25:02 -07:00
Michael Vines 6d62ea6cc7 Drop _program_id 2022-01-24 17:41:47 -08:00
Michael Vines 8e559ce69c Add --program-id argument 2022-01-24 17:41:47 -08:00
Michael Vines c309e10b84 Restore rent sysvar to create_associated_token_account 2022-01-24 15:05:07 -08:00
Tyera Eulberg 533f767563
Revert ATA to spl-token v3.3 (#2796) 2022-01-24 15:41:14 -07:00
Tyera Eulberg 83c3ffad25
Bump solana crates to v1.9.5 (#2780)
* Bump solana crates to v1.9.5

* Update sol_set_return_data type signature and un-ignore test
2022-01-21 22:52:10 -07:00
Jon Cinque 54cb4ad1d8
associated-token-account: Revert to using spl-token-2022 (#2769)
* associated-token-account: Revert to using spl-token-2022

* Clear up no-entrypoint feature for rust client
2022-01-21 19:17:44 +01:00
Jon Cinque 78e7a9538e
associated-token-account: Bump dependent token version to 3.3 (#2766)
* associated-token-account: Bump dependent token version to 3.3

* Fix uses of deprecated instruction
2022-01-21 11:01:06 +01:00
Tyera Eulberg d3a597d2f7
Use spl-token-2022 in ATA program (#2737)
* Bump ATA to spl-token-2022

* Use latest program to fix id mismatch in deprecated ix test
2022-01-13 18:40:35 -07:00
Tyera Eulberg 7fd1b6b75f
Fixup tests to use rent-exempt accounts (#2717) 2022-01-10 09:49:32 -07:00
Jon Cinque 6ee008d256
Update SDK to 1.9.2, fix warnings (#2674)
* Update SDK to 1.9.2, fix warnings

* Upgrade honggfuzz

* Use `get_latest_blockhash` correctly
2021-12-28 23:02:47 -05:00
Michael Vines 9acb082dc3 Upgrade to Solana v1.8.1 2021-10-20 22:52:19 -07:00
Michael Vines 12732f8d5a Upgrade to Solana 1.8.0 2021-10-12 09:40:06 -07:00
Michael Vines abc06eed68 Avoid hard coding spl_token id 2021-09-29 12:49:15 -07:00
Sebastian Bor 1db4604c8d
ATA: update token dependency comments (#2415) 2021-09-15 12:25:26 +01:00
Sebastian Bor 886e7e6540
ATA: Create explicit CreateAssociatedTokenAccount instruction (#2397)
* feat: create explicit CreateAssociatedTokenAccount instruction

* feat: add create_associated_token_account for explicit instruction

* chore: update comments and make clippy happy

* chore: redirect legacy instruction creator to new instruction

* chore: update comments

* wip: scaffold mint to instruction creator and test

* Revert "wip: scaffold mint to instruction creator and test"

This reverts commit f8254050f8dd0c1b3d103277697be3d1037c8a5e.

* chore: flag legacy create_associated_token_account as deprecated

* chore: rename CreateAssociatedTokenAccount to Create

* chore: move create_pda_account to tools:account

* chore: comment deprecated attribute to prevent warnings until 1.0.4 is released

* chore: fix test name

* feat: remove Rent account from explicit instruction

* chore: use current spl_token for implicit instruction test

* chore: replicate legacy implicit instruction in test

* chore: remove program name from instruction msg
2021-09-13 10:41:18 +01:00
Michael Vines 4406265d4a Upgrade to Solana 1.7.11 2021-08-30 12:41:08 -07:00
Henry-E 928bb764ed
Create the ATA account in one CPI call (unless it already has lamports in it) (#2325)
* create account in one cpi call unless already has lamports

* move create PDA account to its own function

* clippy

Co-authored-by: = <nonsense>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-08-27 11:37:51 -07:00
Tyera Eulberg 30fccebdc6
Bump solana crates (#2139) 2021-07-23 16:47:06 +00:00
Jon Cinque 7fda501180
atoken: Bump version (#2120) 2021-07-21 01:27:08 +02:00
Jon Cinque ddc029e14d
token: Bump to 3.2.0 everywhere (#2116) 2021-07-20 23:40:32 +02:00
Tyera Eulberg 0acc8c8bad
Bump solana and borsh crates (#2015) 2021-07-02 16:53:41 +00:00
Jon Cinque 21f8af34e7
Update all solana dependencies to 1.7.3, fix issues (#1958)
* Update all dependencies to 1.7.3, fix issues

* Remove esm from mocha

* Fix missed token test

* Also update rust version

* token-swap: update tolerance on sim test

* Run `cargo clippy --fix` for needless_borrow errors

* Rerun cargo fmt
2021-06-25 00:39:08 +02:00
Tyera Eulberg e28af24443 Bump solana version 2021-06-14 16:02:27 -06:00
Trent Nelson 1f36ca301b Bump solana crates to v1.6.7 2021-05-05 04:39:49 +00:00
Michael Vines 1e47030549 Update SPL to Solana v1.6.6 2021-04-23 13:39:51 -07:00
Michael Vines 448be67cfa Update to Solana 1.6.2 2021-03-30 09:38:04 -07:00
Michael Vines 662f38f939 Bump Solana version to 1.6.1 2021-03-18 04:07:16 +00:00
Michael Vines 686444088b Bump Solana version to 1.5.15 2021-03-16 18:33:37 -07:00
Michael Vines 995d4a029f Remove tokio dev-dependency 2021-03-16 18:33:37 -07:00
Ryo Onodera 68b8da2996
Support associated token for JS (Also, make the program testable) (#1364)
* Implement some js helpers for associated tokens

* Create integration test and fix hard-coding in spl-associated-token

* Run lint:fix and pretty:fix

* Run flow as well...

* More robust test fixture setup

* Revert api breaking part

* Fix tests...

* Populate ts/flow type definitions

* Improve test a bit

* More consistent arg order; docs; more tests

* lints and pretty

* type definition updates and test tweaks

* More simplification...

* More cleanup

* Address review comments and small cleanings

* Bump the version
2021-03-03 20:56:22 +09:00
Jon Cinque 9c12b50703
Update solana-program to 1.5.11 (#1362)
* Update solana-program to 1.5.11

* Update all programs
2021-03-02 19:19:50 +01:00
dependabot[bot] 5b4c62ce49
build(deps): bump solana-program from 1.5.6 to 1.5.8 (#1261)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.6 to 1.5.8.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.5.6...v1.5.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 23:56:18 +00:00
Trent Nelson 2316b6092e chore: token - bump version to 3.1.0 2021-02-11 16:30:03 -07:00
Trent Nelson 188c03e9a1 chore: bump solana crates to 1.5.6 2021-02-11 16:30:03 -07:00
Trent Nelson 63be67e3ee Remove stray .so 2021-01-19 21:27:50 +00:00
dependabot[bot] 7b81c0d3c0
build(deps): bump solana-program from 1.5.0 to 1.5.1 (#1025)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.5.0...v1.5.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 13:51:29 +00:00
Michael Vines 8ae34d2137 Update to Solana 1.5.0 2020-12-17 21:24:30 -08:00