Commit Graph

178 Commits

Author SHA1 Message Date
Maximilian Schneider 6c5802a169 upgrade spl-token-2022 2023-05-17 19:29:04 +00:00
Maximilian Schneider e0bb34e621 prevent upgrade to yanked solana release 2023-05-17 19:14:24 +00:00
acheron c1667120e6
bench: Add a script to sync benchmark results for all versions (#2477) 2023-05-03 09:09:41 +02:00
acheron 5910dd3e2f
Add benchmarking for compute units usage (#2466) 2023-04-24 10:33:11 +02:00
CanardMandarin 2e89b79c51
fix: used identifiers in handler (#2464) 2023-04-22 21:26:22 +02:00
Elliot Kennedy 670b4f5005
Add `token_program` constraint to token, mint, and associated token accounts (#2460) 2023-04-19 10:43:24 +02:00
Pierre 9a075087d0
feat: Add account-dir test-validator argument support (#2436) 2023-03-24 13:13:18 -05:00
Henry-E 3b45144787
v0.27.0 (#2428) 2023-03-08 13:28:23 +00:00
Henry-E 30083bd83c
Simple versioned transaction support (#2427) 2023-03-07 15:08:29 +00:00
Henry-E 1dc16d6642
Revert "Simple Versioned Transaction Support (#2407)" (#2426)
This reverts commit 064dde4b1a.
2023-03-06 12:22:58 +00:00
Henry-E 064dde4b1a
Simple Versioned Transaction Support (#2407) 2023-03-06 12:07:24 +00:00
Henry-E 45fa9bd3ba
Update Solana-program and rust-version (#2420) 2023-03-02 17:23:16 +00:00
Henry-E 90383a7a22
fix redos vulnerability (#2412) 2023-03-01 16:01:41 +00:00
dependabot[bot] 2c94467e67
Bump json5 from 1.0.1 to 1.0.2 in /tests (#2411) 2023-03-01 16:01:19 +00:00
Jon Cinque 777f2eace1
interface: Support multiple programs with the same interface via token-2022 (#2386) 2023-02-27 10:55:08 +00:00
Jean Marchand (Exotic Markets) c76641f861
lang: remove deprecated accounts (#2375) 2023-02-06 16:46:09 +00:00
nojob1 cb680809f0
make idl enum fields which are snake case have proper typing to camel case (#2378) 2023-02-01 11:56:12 +00:00
Christian Kamm ed2769ef28
Make zero copy safe by default, add `account(zero_copy(unsafe))` feature. (#2330) 2023-01-26 14:46:57 +00:00
Jean Marchand (Exotic Markets) a0ef4ed7a4
lang: add the InitSpace macro (#2346) 2023-01-26 11:22:48 +00:00
Jean Marchand (Exotic Markets) 5f9b5905dc
ts: remove duplicate functions (#2357) 2023-01-24 10:39:31 +00:00
Christian Kamm 27bb695685
Idl: Limit account size to 60kb, allow closing idl accounts (#2329) 2023-01-05 13:25:21 +00:00
Sammy Harris 9ba0223c58
box up some accounts in Optional test (#2344) 2023-01-03 16:59:01 +00:00
Jean Marchand (Exotic Markets) 38bbb21c33
lang: remove the state and interface attributes (#2285) 2022-12-22 16:33:44 +00:00
Henry-E 4bef8c40ef
Switch to using @coral-xyz/anchor packages (#2318) 2022-12-16 13:21:50 +00:00
Henry-E 347c225a27
v0.26.0 (#2315)
* v0.26.0

* update packages

* typedocs

Co-authored-by: henrye <henry@notanemail>
2022-12-15 16:12:22 +00:00
Jean Marchand (Exotic Markets) fad05805d8
spl: change serum-dex to openbook-dex (#2308)
* Change serum-dex by openbook-dex

* Change serum-dex by openbook-dex in tests

* Fix swap

* Fix cfo

* Downgrade openbook

* Disable cfo and update changelog

* Revert lock file

* minor grammar

* update the pubkey to open dex

* Remove @solana/web3.js from ts package.json

Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
Co-authored-by: henrye <henry@notanemail>
2022-12-12 16:12:33 +00:00
Adithya Narayan b662ff1460
cli: `anchor account` subcommand to read program account (#1923)
* Setup account subcommand skeleton

* Move IDL deserialization code to syn module

* Change HashMap to serde_json

* Add enum deserialization

* Add account subcommand to docs

* Fix lint

* Add validation for account type

* Fix solana-sdk dependency version

* Fix clippy warnings

* Move IDL deserialization code to cli module

* Remove debug print

* Add integration tests

* Update documentation with example

* Fix clippy warnings

* Fix leftover merge conflict

* run prettier

Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
Co-authored-by: henrye <henry@notanemail>
2022-12-12 16:11:26 +00:00
Sammy Harris 484628070c
Feat: Optional Positional Accounts (#2101)
* optional accounts initial implementation

* cargo fmt

* panic if Account related traits are run on none

* Allow empty accounts to deserialize to None for optional accounts

* implement constraints for optional accounts

* optional accounts to idl gen

* accountstruct helper method

* implemented to_account_metas and infos

* add test program

* Rename optional to is_optional

* added more traits

* added TryKey error

* fix has_one

* update prelude

* is_optional

* add is_optional helper method

* Add TryAccountInfos trait

* improve constraint parser

* initial work on TryToAccountInfo

* Rename to TryToAccountInfo

* finished implementing tryToAccountInfo

* Using program method

* Formatting

* Fix program function call

* Remove function return borrow

* Fix access to program field

* finished implementing tryToAccountInfo

* add exit try_to_account_infos

* descriptive ID path

* try_to_account_info

* fix close constraint

* update test files

* completed typescript optional accounts implementation

* fix try accounts for init

* update tests

* fix to_account_metas

* update tests

* fix linting

* remove types/node

* update yarn.lock maybe?

* update optional test

* update optional test

* update optional rust cli test

* fix linting and tests

* fix tests

* update try_accounts to pass in accs during constraint gen

* Add default impl for TryToAccountInfos

* Removed TryToAccountInfos trait

* Formatting

* remove unneccesary traits and improve constraint gen drastically

* fix exit generation

* clippy

* improve cross check error message

* improve comments

* more comments

* update constraints hopefully good now?

* add new errors to ts client

* add new errors to ts client

* update optional test

* update anchor ts client

* update misc crate

* linting

* temporarily comment out optional rs tests

* update ts

* remove local test files

* linting

* optional client tests

* fix other lints to make the test pass

* remove comments

* remove misc-optional for now

* update optional program

* update optional program and client tests again

* update optional program and client tests again again

* added initialize tests that should pass

* undo unrelated anchor.toml change

* update close on optional program and improve tests

* update optional program again.

* update optional program and optional tests

* fix has one error message

* fix client example tests

* update lockfile

* update lockfile

* regenerate lockfile

* reset lockfile

* reset ts yarn lockfile

* update no caching tests

* update exit codegen to use generate_optional_check

* remove `try_to_account_infos`

* update parser to ignore method calls in constraints

* refactor and improve optional checks in constraints

* add misc-optional program and tests

* enable cpi for optional tests

* Revert "enable cpi for optional tests"

This reverts commit c864cd5d4f019e6bd5f93641e01bd82fc74041d4.

* simplify misc tests

* update version

* fix rust version and resolve merge conflicts

* prevent Option on composite accounts

* hopefully fixed ts stuff?

* hopefully fixed ts stuff?

* testing

* hopefully done?

* update misc test

* fix optional tests

* fix ts

* fix ts again!

* linting urg

* allow-missing-optionals feature

* fix client tests

* add bnjs types to tests

Co-authored-by: febo <febo@kent.ac.uk>
Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
2022-12-12 15:32:59 +00:00
Henry-E 09b829d1a3
Identity com bugfix/robust fetch nullable (#2301)
* ts: Fixed `.fetchNullable()` to be robust towards accounts only holding a balance

* update changelog to new PR id

* prettier

Co-authored-by: Martin Riedel <web@riedel-it.de>
Co-authored-by: henrye <henry@notanemail>
2022-12-07 10:54:45 +00:00
skrrb 6814ce646e
cli: run a subset of the test suites (#1864)
* cli: run subset of tests with --run

* changelog

* test

* fix run test path

* test: added missing package.json

* cli: run subset of tests with --run

* changelog

* test

* fix run test path

* test: added missing package.json

Co-authored-by: Armani Ferrante <armaniferrante@gmail.com>
Co-authored-by: henrye <henry@notanemail>
2022-12-06 21:42:10 +00:00
Henry-E 66e4295fe0
drop rust version to allow earlier CLIs to compile (#2289)
* drop back rust version to allow earlier cli to compile

* update solana program to 1.13.5 latest mainnet version

Co-authored-by: henrye <henry@notanemail>
2022-11-29 11:36:48 +00:00
Henry-E 19e00e5d8f
Don't allow the payer to be initialized as a program account (#2284)
* don't allow people to initialize the payer as a program account

* update changelog

* accidentally commented out part of another test

Co-authored-by: henrye <henry@notanemail>
2022-11-25 15:12:58 +00:00
Jean Marchand (Exotic Markets) c0d3ff2d77
tests: Fix multiple suites example (#2279) 2022-11-23 10:48:46 +00:00
Henry-E 5291a7b6ff
Update rust to v1.62 (#2272)
* update rust from v1.56 to v1.65

* remove unnecessary borrows to appease clippy

* stop clippy complaining for now

* use 1.64 instead because of CI stuff

* update CHANGLEOG

* just seeing if the cli version is affecting the available rust version

* ok, back to 1.62

Co-authored-by: henrye <henry@notanemail>
2022-11-22 16:13:45 +00:00
Henry-E afbbbb0330
Trying to stop `zero-copy` test failing (#2274)
* trying out different solutions to zero copy issue (none work yet)

* using a newer version of the CLI should fix the issue

* re update solana client version

* add cargo.lock for some reason

* comment out broken test, get help later

* clippy doesn't like the new option

Co-authored-by: henrye <henry@notanemail>
2022-11-22 15:40:07 +00:00
Callum McIntyre 982799b7e6
Fix panic parsing seeds when account has qualified path (#2268)
* Fix panic parsing seeds when account has qualified path

* Add a test for seed derivation with account using type with path
2022-11-22 11:10:05 +00:00
Jean Marchand (Exotic Markets) 8ce18c36db
spl: Update instructions and remove rent from constraints (#2265)
* Update spl instructions and remove the rent sys_var from constraints

* Fix initialize mint

* Update changelog and fix examples

* Remove oversights
2022-11-19 12:59:14 +00:00
acheron af115999c6
ts: Remove SPL coders from Anchor package (#2155)
* ts: Remove SPL coders from Anchor package

* Replace old SPL custom coder tests

* Build and link new SPL packages before tests and decode token account for AccountStore

* Fix Github actions ts setup

* Fix u64 buffer length

* Update submodules

* Update CHANGELOG

* Checkout correct submodule commits

* Add filler program to generate idls in order for anchor test to pass
2022-11-17 14:17:22 +00:00
Jean Marchand b107cbe94f
lang: Fix parsing for bytes literals in the IDL (#2261)
* lang: Fix parsing of some constants

* Fix lint + changelog
2022-11-16 15:59:09 +00:00
Deep Mehta e8618a588f
replace getRecentBlockhash to getLatestBlockhash (#2205) 2022-11-14 16:59:36 +00:00
omahs 43ab991852
Fix: typos (#2236)
Fix: typos
2022-11-14 16:57:41 +00:00
Noah Prince feff131ab0
fix: Nested pda types and account resolution for pdas (#2259) 2022-11-13 21:45:41 -05:00
Henry-E 7a0a37e0f8
Update solana to version 1.13.3 (#2239)
* upgrade solana version to 1.13.3

* get everything to compile correctly

* update to using struct constructor to avoid deprecated field usage

* update deprecated functions

* more fixes to pass tests

* update auction-house submodule commit

* update the swap submodule

Co-authored-by: henrye <henry@notanemail>
2022-10-29 15:23:13 +01:00
Sammy Harris fa1249836e
Feat: Update AccountsClose to be safe to call manually (#2209)
* fix other lints to make the test pass

(cherry picked from commit d6e43c1ed6a176caa60dfdabe406ec125c3d34cf)

* update close to make it safe to call manually

* fix test script

* re-add safety warnings for deprecated account types

* update close checking logic

* readd logic for deprecated methods

* add additional checks to account_loader in exit
2022-10-21 17:06:54 +01:00
Totoro 8e66d5bb5f
Add support for idl enum tuples, enchance types (#2185) 2022-10-18 10:13:23 -04:00
Sammy Harris 3da28dbc5f
fix: ignore non Accounts in safety checks (#2201) 2022-10-13 23:08:02 -04:00
Sammy Harris 5647510615
chore: bump @solana/web3.js in anchor-ts (#2227) 2022-10-13 23:06:51 -04:00
Henry-E d83efcdc3a
update solana web3 package to 1.64.0 (#2223)
* update solana web3 package to 1.64.0

* fix some missing packages; update changelog

* fix weird prettier thing messing with changelog

* also upgrade the yarn.lock in tests
2022-10-13 11:20:32 +01:00
Noah Prince fd467df932
feat: Derive has_one's from other programs, recursively search custom resolvers (#2208) 2022-10-08 00:33:18 -04:00
Noah Prince 436791b039
feat: Recursively derive seeds and add custom account resolver (#2194) 2022-09-21 16:32:24 -04:00