Commit Graph

35 Commits

Author SHA1 Message Date
Henry-E 4bef8c40ef
Switch to using @coral-xyz/anchor packages (#2318) 2022-12-16 13:21:50 +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 c864cd5d4f.

* 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
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
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
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 e69e50daaf
feat: Add has_one relations inference so you don't need to pass accounts that are referenced by a has_one (#2160) 2022-09-10 12:52:59 -04:00
acheron 5a025b949e
ts: Add SPL Anchor packages (#2143) 2022-08-22 21:57:56 -04:00
Matthew Callens c47fb2877e
lang: adjust `realloc` implementation to safeguard max increase and idempotency (#1986) 2022-07-05 15:54:40 -04:00
Armani Ferrante 1ec9af7e21
Revert "lang: add `realloc` constraint group (#1943)" (#1984)
This reverts commit 7fe39c61ad.
2022-06-17 17:16:10 -04:00
Matthew Callens 7fe39c61ad
lang: add `realloc` constraint group (#1943) 2022-06-04 20:25:28 -04:00
Tom Linton b885c7b68c
tests: Add CLI IDL command tests (#1808) 2022-04-20 17:38:45 -04:00
Paul 42663eda25
ci: ci should error if tests have typescript errors (#1801) 2022-04-17 15:54:28 -04:00
Paul d07853e9ef
fix anchor-init ci and bpf-upgradeable-state package.json (#1781) 2022-04-12 19:29:52 -04:00
Paul b665f28b16
update anchor ts dep paths (#1778) 2022-04-12 18:16:04 -04:00
Armani Ferrante b0f263214d
v0.24.0 (#1769) 2022-04-12 10:52:06 -04:00
Paul 470e902f48
lang: Add support for multiple test suites with separate local validators (#1681) 2022-03-30 17:17:54 -04:00
Tom Linton 1cb7429fe2
lang: Allow CPI return values (#1598) 2022-03-24 14:40:38 -04:00
Armani Ferrante 77b1afcf2f
v0.23.0 (#1660) 2022-03-20 23:30:55 -04:00
Paul 9afdb17ac2
ts: add error log parsing to ts client (#1640) 2022-03-20 20:29:12 -04:00
skrrb 3c994fcdef
cli: also clone program data account (#1495) 2022-03-12 17:36:35 -05:00
Armani Ferrante b733610d87
v0.22.1 (#1528) 2022-02-28 11:35:59 -05:00
Armani Ferrante 24ccaea903
v0.22.0 (#1484) 2022-02-20 20:32:38 -05:00
Pavel Kuzovkin 90bcea1cbe
lang, ts: float types support (#1425) 2022-02-17 14:23:21 -05:00
Paul 1f56a62bab
lang: add check that declared id == program id (#1451) 2022-02-15 18:16:06 -05:00
Armani Ferrante ef1a58d665
v0.21.0 (#1403) 2022-02-07 20:10:49 -05:00
Armani Ferrante d8d720067d
lang, ts: automatic client side pda derivation (#1331) 2022-01-24 14:44:24 -05:00
Armani Ferrante 84e0852584
ts: `Coder` as interface and SPL token coder (#1259) 2022-01-09 21:10:25 -05:00
Armani Ferrante a81ff88d76
v0.20.1 (#1274) 2022-01-09 16:50:10 -05:00
Armani Ferrante 9c47c0a6cd
v0.20.0 (#1251) 2022-01-06 18:09:43 -05:00
Tom Linton 713d43668b
examples, tests: Setup prettier (#1152) 2021-12-15 18:11:41 -05:00
Armani Ferrante 3afd1a22e4
v0.19.0 (#1116) 2021-12-08 17:33:36 -05:00
Tom Linton 1319dc65d6
v0.18.2 (#1011) 2021-11-13 18:58:10 -08:00
Tom Linton 468fe79473
cli, examples, tests: Remove global JavaScript dependencies in favour of local (#990) 2021-11-11 22:38:35 +00:00