Compare commits
7 Commits
f16264aa82
...
c58cf69e9d
Author | SHA1 | Date |
---|---|---|
dfy313 | c58cf69e9d | |
czkz | c96846fce2 | |
acheron | 10c997552e | |
David Yu | d6715a8327 | |
dfy313 | 4f8b32d9ad | |
David Yu | 6ac4d9e86d | |
David Yu | a2c404decd |
|
@ -460,6 +460,8 @@ jobs:
|
|||
path: tests/bench
|
||||
- cmd: cd tests/idl && ./test.sh
|
||||
path: tests/idl
|
||||
- cmd: cd tests/solana-program-test-compatibility && cargo test-sbf --package solana-program-test-compatibility --test compatibility_test check_entrypoint
|
||||
path: tests/idl
|
||||
# TODO: Enable when `solang` becomes compatible with the new IDL spec
|
||||
# - cmd: cd tests/solang && anchor test
|
||||
# path: tests/solang
|
||||
|
|
|
@ -16,7 +16,8 @@ The minor version will be incremented upon a breaking change and the patch versi
|
|||
|
||||
### Fixes
|
||||
|
||||
- syn: Eliminate variable allocations that build up stack space for token extension code generation ([#2913](https://github.com/coral-xyz/anchor/pull/2913)).
|
||||
- lang: Eliminate variable allocations that build up stack space for token extension code generation ([#2913](https://github.com/coral-xyz/anchor/pull/2913)).
|
||||
- ts: Fix incorrect `maxSupportedTransactionVersion` in `AnchorProvider.send*()` methods ([#2922](https://github.com/coral-xyz/anchor/pull/2922)).
|
||||
|
||||
### Breaking
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -15,6 +15,8 @@ publish:
|
|||
sleep 25
|
||||
cd lang/derive/accounts/ && cargo publish && cd ../../../
|
||||
sleep 25
|
||||
cd lang/derive/serde/ && cargo publish && cd ../../../
|
||||
sleep 25
|
||||
cd lang/derive/space/ && cargo publish && cd ../../../
|
||||
sleep 25
|
||||
cd lang/attribute/access-control/ && cargo publish && cd ../../../
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
"spl/token-proxy",
|
||||
"spl/token-wrapper",
|
||||
"spl/transfer-hook",
|
||||
"solana-program-test-compatibility",
|
||||
"swap",
|
||||
"system-accounts",
|
||||
"sysvars",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
.anchor
|
||||
.DS_Store
|
||||
target
|
||||
node_modules
|
||||
dist
|
||||
build
|
||||
test-ledger
|
|
@ -0,0 +1,18 @@
|
|||
[toolchain]
|
||||
|
||||
[features]
|
||||
seeds = false
|
||||
skip-lint = false
|
||||
|
||||
[programs.localnet]
|
||||
solana_program_test_compatibility = "3cgdzWdfZSy1GaV6Lg98iwLvTcL9W7AVD8BpxiZjCZ9z"
|
||||
|
||||
[registry]
|
||||
url = "https://api.apr.dev"
|
||||
|
||||
[provider]
|
||||
cluster = "Localnet"
|
||||
wallet = "/Users/david/.config/solana/id.json"
|
||||
|
||||
[scripts]
|
||||
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
|
|
@ -0,0 +1,13 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"programs/*"
|
||||
]
|
||||
|
||||
[profile.release]
|
||||
overflow-checks = true
|
||||
lto = "fat"
|
||||
codegen-units = 1
|
||||
[profile.release.build-override]
|
||||
opt-level = 3
|
||||
incremental = false
|
||||
codegen-units = 1
|
|
@ -0,0 +1,12 @@
|
|||
// Migrations are an early feature. Currently, they're nothing more than this
|
||||
// single deploy script that's invoked from the CLI, injecting a provider
|
||||
// configured from the workspace's Anchor.toml.
|
||||
|
||||
const anchor = require("@coral-xyz/anchor");
|
||||
|
||||
module.exports = async function (provider) {
|
||||
// Configure client to use the provider.
|
||||
anchor.setProvider(provider);
|
||||
|
||||
// Add your deploy script here.
|
||||
};
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"scripts": {
|
||||
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
|
||||
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coral-xyz/anchor": "^0.29.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.4",
|
||||
"mocha": "^9.0.3",
|
||||
"ts-mocha": "^10.0.0",
|
||||
"@types/bn.js": "^5.1.0",
|
||||
"@types/chai": "^4.3.0",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"typescript": "^4.3.5",
|
||||
"prettier": "^2.6.2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
[package]
|
||||
name = "solana-program-test-compatibility"
|
||||
version = "0.1.0"
|
||||
description = "Created with Anchor"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
name = "solana_program_test_compatibility"
|
||||
|
||||
[features]
|
||||
no-entrypoint = []
|
||||
no-idl = []
|
||||
no-log-ix-name = []
|
||||
cpi = ["no-entrypoint"]
|
||||
default = []
|
||||
|
||||
[dependencies]
|
||||
anchor-lang = { path = "../../../../lang" }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = ">=1.16, <1.18"
|
|
@ -0,0 +1,2 @@
|
|||
[target.bpfel-unknown-unknown.dependencies.std]
|
||||
features = []
|
|
@ -0,0 +1,15 @@
|
|||
use anchor_lang::prelude::*;
|
||||
|
||||
declare_id!("3cgdzWdfZSy1GaV6Lg98iwLvTcL9W7AVD8BpxiZjCZ9z");
|
||||
|
||||
#[program]
|
||||
pub mod solana_program_test_compatibility {
|
||||
use super::*;
|
||||
|
||||
pub fn initialize(_ctx: Context<Initialize>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Accounts)]
|
||||
pub struct Initialize {}
|
|
@ -0,0 +1,10 @@
|
|||
use solana_program_test::ProgramTest;
|
||||
|
||||
#[test]
|
||||
fn check_entrypoint() {
|
||||
let _pt = ProgramTest::new(
|
||||
"solana_program_test_compatibility",
|
||||
solana_program_test_compatibility::id(),
|
||||
None,
|
||||
);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"types": ["mocha", "chai"],
|
||||
"typeRoots": ["./node_modules/@types"],
|
||||
"lib": ["es2015"],
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
|
|
@ -174,8 +174,10 @@ export class AnchorProvider implements Provider {
|
|||
? tx.signatures?.[0] || new Uint8Array()
|
||||
: tx.signature ?? new Uint8Array()
|
||||
);
|
||||
const maxVer = isVersionedTransaction(tx) ? 0 : undefined;
|
||||
const failedTx = await this.connection.getTransaction(txSig, {
|
||||
commitment: "confirmed",
|
||||
maxSupportedTransactionVersion: maxVer,
|
||||
});
|
||||
if (!failedTx) {
|
||||
throw err;
|
||||
|
@ -256,8 +258,10 @@ export class AnchorProvider implements Provider {
|
|||
? tx.signatures?.[0] || new Uint8Array()
|
||||
: tx.signature ?? new Uint8Array()
|
||||
);
|
||||
const maxVer = isVersionedTransaction(tx) ? 0 : undefined;
|
||||
const failedTx = await this.connection.getTransaction(txSig, {
|
||||
commitment: "confirmed",
|
||||
maxSupportedTransactionVersion: maxVer,
|
||||
});
|
||||
if (!failedTx) {
|
||||
throw err;
|
||||
|
|
Loading…
Reference in New Issue