From 4324db138d622173c2f88baf1b8fb5bfa059bfbb Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 03:20:21 +0100 Subject: [PATCH 01/21] lang: Add ProgramData account --- .github/workflows/tests.yaml | 40 + Cargo.lock | 1 + lang/Cargo.toml | 1 + lang/src/error.rs | 2 + lang/src/lib.rs | 4 +- lang/src/program_data.rs | 149 ++ lang/syn/src/codegen/program/handlers.rs | 8 +- lang/syn/src/lib.rs | 8 + lang/syn/src/parser/accounts/mod.rs | 2 + tests/program-data/.gitignore | 6 + tests/program-data/Anchor.toml | 12 + tests/program-data/Cargo.toml | 4 + tests/program-data/migrations/deploy.ts | 12 + tests/program-data/package.json | 12 + .../programs/program-data/Cargo.toml | 18 + .../programs/program-data/Xargo.toml | 2 + .../programs/program-data/src/lib.rs | 32 + tests/program-data/tests/program-data.ts | 82 ++ tests/program-data/tsconfig.json | 10 + tests/program-data/yarn.lock | 1202 +++++++++++++++++ ts/src/error.ts | 5 + 21 files changed, 1606 insertions(+), 6 deletions(-) create mode 100644 lang/src/program_data.rs create mode 100644 tests/program-data/.gitignore create mode 100644 tests/program-data/Anchor.toml create mode 100644 tests/program-data/Cargo.toml create mode 100644 tests/program-data/migrations/deploy.ts create mode 100644 tests/program-data/package.json create mode 100644 tests/program-data/programs/program-data/Cargo.toml create mode 100644 tests/program-data/programs/program-data/Xargo.toml create mode 100644 tests/program-data/programs/program-data/src/lib.rs create mode 100644 tests/program-data/tests/program-data.ts create mode 100644 tests/program-data/tsconfig.json create mode 100644 tests/program-data/yarn.lock diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 00433026fc..3c3786aed6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -179,6 +179,44 @@ jobs: - uses: ./.github/actions/setup-solana/ - run: cd client/example && ./run-test.sh + test-program-data: + needs: setup-anchor-cli + name: Test tests/program-data + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/setup/ + - uses: ./.github/actions/setup-ts/ + - uses: ./.github/actions/setup-solana/ + + - uses: actions/cache@v2 + name: Cache Cargo registry + index + id: cache-anchor + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ./target/ + key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions/download-artifact@v2 + with: + name: anchor-binary + path: ~/.cargo/bin/ + + - uses: actions/cache@v2 + name: Cache tests/program-data target + id: cache-test-target + with: + path: tests/program-data/target + key: cargo-${{ runner.os }}-tests/program-data-${{ env.ANCHOR_VERSION }} + + - run: solana-test-validator -r --quiet & + name: start validator + - run: cd tests/program-data && anchor build && anchor deploy && anchor test --skip-deploy + test-programs: needs: setup-anchor-cli name: Test ${{ matrix.node.path }} @@ -224,6 +262,8 @@ jobs: path: tests/ido-pool - cmd: cd tests/cfo && anchor run test-with-build path: tests/cfo + - cmd: cd tests/program-data && anchor test + path: tests/program-data steps: - uses: actions/checkout@v2 - uses: ./.github/actions/setup/ diff --git a/Cargo.lock b/Cargo.lock index 3076b71f95..63044db55e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,6 +213,7 @@ dependencies = [ "anchor-attribute-state", "anchor-derive-accounts", "base64 0.13.0", + "bincode", "borsh", "bytemuck", "solana-program", diff --git a/lang/Cargo.toml b/lang/Cargo.toml index e97f56a280..2af4b3a00f 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -38,3 +38,4 @@ borsh = "0.9" bytemuck = "1.4.0" solana-program = "1.8.0" thiserror = "1.0.20" +bincode = "1.3.3" diff --git a/lang/src/error.rs b/lang/src/error.rs index 93086d2038..70a7ca977e 100644 --- a/lang/src/error.rs +++ b/lang/src/error.rs @@ -76,6 +76,8 @@ pub enum ErrorCode { AccountNotSystemOwned, #[msg("The program expected this account to be already initialized")] AccountNotInitialized, + #[msg("The given account is not a program data account")] + AccountNotProgramData, // State. #[msg("The given state account does not have the correct address")] diff --git a/lang/src/lib.rs b/lang/src/lib.rs index 60b9b1114e..8b79ca649e 100644 --- a/lang/src/lib.rs +++ b/lang/src/lib.rs @@ -47,6 +47,7 @@ mod loader; mod loader_account; mod program; mod program_account; +mod program_data; mod signer; pub mod state; mod system_account; @@ -73,6 +74,7 @@ pub use crate::program::Program; #[doc(hidden)] #[allow(deprecated)] pub use crate::program_account::ProgramAccount; +pub use crate::program_data::*; pub use crate::signer::Signer; #[doc(hidden)] #[allow(deprecated)] @@ -255,7 +257,7 @@ pub mod prelude { require, state, zero_copy, Account, AccountDeserialize, AccountLoader, AccountSerialize, Accounts, AccountsExit, AnchorDeserialize, AnchorSerialize, Context, CpiContext, Id, Key, Owner, Program, Signer, System, SystemAccount, Sysvar, ToAccountInfo, ToAccountInfos, - ToAccountMetas, UncheckedAccount, + ToAccountMetas, UncheckedAccount, ProgramData, ProgramDataInner }; #[allow(deprecated)] diff --git a/lang/src/program_data.rs b/lang/src/program_data.rs new file mode 100644 index 0000000000..311d000e9b --- /dev/null +++ b/lang/src/program_data.rs @@ -0,0 +1,149 @@ +use crate::error::ErrorCode; +use crate::*; +use solana_program::bpf_loader_upgradeable; +use solana_program::entrypoint::ProgramResult; +use solana_program::instruction::AccountMeta; +use solana_program::program_error::ProgramError; +use solana_program::pubkey::Pubkey; +use solana_program::{account_info::AccountInfo, bpf_loader_upgradeable::UpgradeableLoaderState}; +use std::ops::Deref; + +#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize)] +pub struct ProgramDataInner { + slot: u64, + upgrade_authority_address: Option, +} + +impl ProgramDataInner { + pub fn slot(&self) -> &u64 { + &self.slot + } + + pub fn upgrade_authority_address(&self) -> &Option { + &self.upgrade_authority_address + } +} + +impl Owner for ProgramDataInner { + fn owner() -> Pubkey { + bpf_loader_upgradeable::ID + } +} + +#[derive(Debug, Clone)] +pub struct ProgramData<'info> { + program_data_inner: ProgramDataInner, + info: AccountInfo<'info>, +} + +impl<'info> ProgramData<'info> { + fn new(info: AccountInfo<'info>, program_data_inner: ProgramDataInner) -> ProgramData<'info> { + Self { + info, + program_data_inner, + } + } + + #[inline(never)] + pub fn try_from(info: &AccountInfo<'info>) -> Result, ProgramError> { + if *info.owner != ProgramDataInner::owner() { + return Err(ErrorCode::AccountNotProgramOwned.into()); + } + let program_state: bpf_loader_upgradeable::UpgradeableLoaderState = + bincode::deserialize(&info.try_borrow_data()?) + .map_err(|_| ProgramError::InvalidAccountData)?; + match program_state { + UpgradeableLoaderState::Uninitialized => { + Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()) + } + UpgradeableLoaderState::Buffer { + authority_address: _, + } => Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()), + UpgradeableLoaderState::Program { + programdata_address: _, + } => Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()), + UpgradeableLoaderState::ProgramData { + slot, + upgrade_authority_address, + } => Ok(ProgramData::new( + info.clone(), + ProgramDataInner { + slot, + upgrade_authority_address, + }, + )), + } + } +} + +impl<'info> Accounts<'info> for ProgramData<'info> { + #[inline(never)] + fn try_accounts( + _program_id: &Pubkey, + accounts: &mut &[AccountInfo<'info>], + _ix_data: &[u8], + ) -> Result { + if accounts.is_empty() { + return Err(ErrorCode::AccountNotEnoughKeys.into()); + } + let account = &accounts[0]; + *accounts = &accounts[1..]; + ProgramData::try_from(account) + } +} + +impl<'info> AccountsExit<'info> for ProgramData<'info> { + fn exit(&self, _program_id: &Pubkey) -> ProgramResult { + // No-op. + Ok(()) + } +} + +impl<'info> ToAccountMetas for ProgramData<'info> { + fn to_account_metas(&self, is_signer: Option) -> Vec { + let is_signer = is_signer.unwrap_or(self.info.is_signer); + let meta = match self.info.is_writable { + false => AccountMeta::new_readonly(*self.info.key, is_signer), + true => AccountMeta::new(*self.info.key, is_signer), + }; + vec![meta] + } +} + +impl<'info> ToAccountInfos<'info> for ProgramData<'info> { + fn to_account_infos(&self) -> Vec> { + vec![self.info.clone()] + } +} + +impl<'info> ToAccountInfo<'info> for ProgramData<'info> { + fn to_account_info(&self) -> AccountInfo<'info> { + self.info.clone() + } +} + +impl<'info> AsRef> for ProgramData<'info> { + fn as_ref(&self) -> &AccountInfo<'info> { + &self.info + } +} + +impl<'info> AsRef for ProgramData<'info> { + fn as_ref(&self) -> &ProgramDataInner { + &self.program_data_inner + } +} + +impl<'info> Deref for ProgramData<'info> { + type Target = ProgramDataInner; + + fn deref(&self) -> &Self::Target { + &self.program_data_inner + } +} + +impl<'info> Key for ProgramData<'info> { + fn key(&self) -> Pubkey { + *self.info.key + } +} diff --git a/lang/syn/src/codegen/program/handlers.rs b/lang/syn/src/codegen/program/handlers.rs index f9c07809b7..3bfa47e1b3 100644 --- a/lang/syn/src/codegen/program/handlers.rs +++ b/lang/syn/src/codegen/program/handlers.rs @@ -486,11 +486,9 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { .methods .iter() .map(|ix| { - if state.is_zero_copy { - // Easy to implement. Just need to write a test. - // Feel free to open a PR. - panic!("Trait implementations not yet implemented for zero copy state structs. Please file an issue."); - } + // Easy to implement. Just need to write a test. + // Feel free to open a PR. + assert!(!state.is_zero_copy, "Trait implementations not yet implemented for zero copy state structs. Please file an issue."); let ix_arg_names: Vec<&syn::Ident> = ix.args.iter().map(|arg| &arg.name).collect(); diff --git a/lang/syn/src/lib.rs b/lang/syn/src/lib.rs index ba17f4ef5b..38033705ab 100644 --- a/lang/syn/src/lib.rs +++ b/lang/syn/src/lib.rs @@ -184,6 +184,9 @@ impl Field { Ty::Signer => quote! { Signer }, + Ty::ProgramData => quote! { + ProgramData + }, Ty::SystemAccount => quote! { SystemAccount }, @@ -298,6 +301,7 @@ impl Field { Ty::UncheckedAccount => quote! {}, Ty::Signer => quote! {}, Ty::SystemAccount => quote! {}, + Ty::ProgramData => quote! {}, } } @@ -316,6 +320,9 @@ impl Field { Ty::SystemAccount => quote! { SystemAccount }, + Ty::ProgramData => quote! { + ProgramData + }, Ty::ProgramAccount(ty) => { let ident = &ty.account_type_path; quote! { @@ -405,6 +412,7 @@ pub enum Ty { Program(ProgramTy), Signer, SystemAccount, + ProgramData, } #[derive(Debug, PartialEq)] diff --git a/lang/syn/src/parser/accounts/mod.rs b/lang/syn/src/parser/accounts/mod.rs index c50db1ab0a..1b8883c5da 100644 --- a/lang/syn/src/parser/accounts/mod.rs +++ b/lang/syn/src/parser/accounts/mod.rs @@ -79,6 +79,7 @@ fn is_field_primitive(f: &syn::Field) -> ParseResult { | "Program" | "Signer" | "SystemAccount" + | "ProgramData" ); Ok(r) } @@ -102,6 +103,7 @@ fn parse_ty(f: &syn::Field) -> ParseResult { "Program" => Ty::Program(parse_program_ty(&path)?), "Signer" => Ty::Signer, "SystemAccount" => Ty::SystemAccount, + "ProgramData" => Ty::ProgramData, _ => return Err(ParseError::new(f.ty.span(), "invalid account type given")), }; diff --git a/tests/program-data/.gitignore b/tests/program-data/.gitignore new file mode 100644 index 0000000000..51448d4dab --- /dev/null +++ b/tests/program-data/.gitignore @@ -0,0 +1,6 @@ + +.anchor +.DS_Store +target +**/*.rs.bk +node_modules diff --git a/tests/program-data/Anchor.toml b/tests/program-data/Anchor.toml new file mode 100644 index 0000000000..10ae0bbe39 --- /dev/null +++ b/tests/program-data/Anchor.toml @@ -0,0 +1,12 @@ +[programs.localnet] +program_data = "Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e" + +[registry] +url = "https://anchor.projectserum.com" + +[provider] +cluster = "localnet" +wallet = "/Users/paul/.config/solana/id.json" + +[scripts] +test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" diff --git a/tests/program-data/Cargo.toml b/tests/program-data/Cargo.toml new file mode 100644 index 0000000000..a60de986d3 --- /dev/null +++ b/tests/program-data/Cargo.toml @@ -0,0 +1,4 @@ +[workspace] +members = [ + "programs/*" +] diff --git a/tests/program-data/migrations/deploy.ts b/tests/program-data/migrations/deploy.ts new file mode 100644 index 0000000000..325cf3d0ec --- /dev/null +++ b/tests/program-data/migrations/deploy.ts @@ -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("@project-serum/anchor"); + +module.exports = async function (provider) { + // Configure client to use the provider. + anchor.setProvider(provider); + + // Add your deploy script here. +} diff --git a/tests/program-data/package.json b/tests/program-data/package.json new file mode 100644 index 0000000000..ada948fdfe --- /dev/null +++ b/tests/program-data/package.json @@ -0,0 +1,12 @@ +{ + "dependencies": { + "@project-serum/anchor": "^0.18.2" + }, + "devDependencies": { + "chai": "^4.3.4", + "mocha": "^9.0.3", + "ts-mocha": "^8.0.0", + "@types/mocha": "^9.0.0", + "typescript": "^4.3.5" + } +} diff --git a/tests/program-data/programs/program-data/Cargo.toml b/tests/program-data/programs/program-data/Cargo.toml new file mode 100644 index 0000000000..06c28d432b --- /dev/null +++ b/tests/program-data/programs/program-data/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "program-data" +version = "0.1.0" +description = "Created with Anchor" +edition = "2018" + +[lib] +crate-type = ["cdylib", "lib"] +name = "program_data" + +[features] +no-entrypoint = [] +no-idl = [] +cpi = ["no-entrypoint"] +default = [] + +[dependencies] +anchor-lang = { path = "../../../../lang" } diff --git a/tests/program-data/programs/program-data/Xargo.toml b/tests/program-data/programs/program-data/Xargo.toml new file mode 100644 index 0000000000..475fb71ed1 --- /dev/null +++ b/tests/program-data/programs/program-data/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/tests/program-data/programs/program-data/src/lib.rs b/tests/program-data/programs/program-data/src/lib.rs new file mode 100644 index 0000000000..78ecf0912d --- /dev/null +++ b/tests/program-data/programs/program-data/src/lib.rs @@ -0,0 +1,32 @@ +use anchor_lang::prelude::*; + +declare_id!("Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e"); + +// TODO: Once anchor can deserialize program data, update this test. +// Add constraint that program.program_data_address == program_data.key() + +#[program] +pub mod program_data { + use super::*; + pub fn set_admin_settings(ctx: Context, admin_data: u64) -> ProgramResult { + ctx.accounts.settings.admin_data = admin_data; + Ok(()) + } +} + +#[account] +#[derive(Default, Debug)] +pub struct Settings { + admin_data: u64 +} + +#[derive(Accounts)] +pub struct SetAdminSettings<'info> { + #[account(init, payer = authority)] + pub settings: Account<'info, Settings>, + #[account(mut)] + pub authority: Signer<'info>, + #[account(constraint = *program_data.upgrade_authority_address() == Some(authority.key()))] + pub program_data: ProgramData<'info>, + pub system_program: Program<'info, System> +} diff --git a/tests/program-data/tests/program-data.ts b/tests/program-data/tests/program-data.ts new file mode 100644 index 0000000000..f714d15b85 --- /dev/null +++ b/tests/program-data/tests/program-data.ts @@ -0,0 +1,82 @@ +import * as anchor from '@project-serum/anchor'; +import { Program } from '@project-serum/anchor'; +import { findProgramAddressSync } from '@project-serum/anchor/dist/cjs/utils/pubkey'; +import { sleep } from '@project-serum/common'; +import assert from 'assert'; +import { ProgramData } from '../target/types/program_data'; + +describe('program-data', () => { + const provider = anchor.Provider.env(); + // Configure the client to use the local cluster. + anchor.setProvider(provider); + + const program = anchor.workspace.ProgramData as Program; + const programDataAddress = findProgramAddressSync( + [program.programId.toBytes()], + new anchor.web3.PublicKey("BPFLoaderUpgradeab1e11111111111111111111111") + )[0]; + + it('Reads ProgramData and sets field', async () => { + const settings = anchor.web3.Keypair.generate(); + const tx = await program.rpc.setAdminSettings(new anchor.BN(500), { + accounts: { + authority: program.provider.wallet.publicKey, + systemProgram: anchor.web3.SystemProgram.programId, + programData: programDataAddress, + settings: settings.publicKey + }, + signers: [settings] + }); + assert.equal((await program.account.settings.fetch(settings.publicKey)).adminData, 500); + + console.log("Your transaction signature", tx); + }); + + it('Validates constraint on ProgramData', async () => { + const settings = anchor.web3.Keypair.generate(); + try { + const authority = anchor.web3.Keypair.generate(); + await provider.connection.confirmTransaction( + await provider.connection.requestAirdrop(authority.publicKey, 10000000000), + "confirmed" + ); + await program.rpc.setAdminSettings(new anchor.BN(500), { + accounts: { + authority: authority.publicKey, + systemProgram: anchor.web3.SystemProgram.programId, + programData: programDataAddress, + settings: settings.publicKey + }, + signers: [settings, authority] + }); + assert.ok(false); + } catch (err) { + assert.equal(err.code, 143); + assert.equal(err.msg, "A raw constraint was violated"); + } + }); + + it('Validates that account is ProgramData', async () => { + const settings = anchor.web3.Keypair.generate(); + try { + const authority = anchor.web3.Keypair.generate(); + await provider.connection.confirmTransaction( + await provider.connection.requestAirdrop(authority.publicKey, 10000000000), + "confirmed" + ); + await program.rpc.setAdminSettings(new anchor.BN(500), { + accounts: { + authority: authority.publicKey, + systemProgram: anchor.web3.SystemProgram.programId, + programData: program.programId, + settings: settings.publicKey + }, + signers: [settings, authority] + }); + assert.ok(false); + } catch (err) { + assert.equal(err.code, 173); + assert.equal(err.msg, "The given account is not a program data account"); + } + }); +}); diff --git a/tests/program-data/tsconfig.json b/tests/program-data/tsconfig.json new file mode 100644 index 0000000000..cd5d2e3d06 --- /dev/null +++ b/tests/program-data/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": ["mocha", "chai"], + "typeRoots": ["./node_modules/@types"], + "lib": ["es2015"], + "module": "commonjs", + "target": "es6", + "esModuleInterop": true + } +} diff --git a/tests/program-data/yarn.lock b/tests/program-data/yarn.lock new file mode 100644 index 0000000000..1c582e8837 --- /dev/null +++ b/tests/program-data/yarn.lock @@ -0,0 +1,1202 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" + integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== + dependencies: + regenerator-runtime "^0.13.4" + +"@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + +"@ethersproject/sha2@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" + integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + hash.js "1.1.7" + +"@project-serum/anchor@^0.18.2": + version "0.18.2" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.18.2.tgz#0f13b5c2046446b7c24cf28763eec90febb28485" + integrity sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ== + dependencies: + "@project-serum/borsh" "^0.2.2" + "@solana/web3.js" "^1.17.0" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.0" + camelcase "^5.3.1" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + find "^0.3.0" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + toml "^3.0.0" + +"@project-serum/borsh@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.2.tgz#63e558f2d6eb6ab79086bf499dea94da3182498f" + integrity sha512-Ms+aWmGVW6bWd3b0+MWwoaYig2QD0F90h0uhr7AzY3dpCb5e2S6RsRW02vFTfa085pY2VLB7nTZNbFECQ1liTg== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@solana/buffer-layout@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" + integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== + dependencies: + buffer "~6.0.3" + +"@solana/web3.js@^1.17.0": + version "1.31.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.31.0.tgz#7a313d4c1a90b77f27ddbfe845a10d6883e06452" + integrity sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^3.0.0" + bn.js "^5.0.0" + borsh "^0.4.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + +"@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/connect@^3.4.33": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/express-serve-static-core@^4.17.9": + version "4.17.26" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz#5d9a8eeecb9d5f9d7fc1d85f541512a84638ae88" + integrity sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + +"@types/lodash@^4.14.159": + version "4.14.177" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.177.tgz#f70c0d19c30fab101cad46b52be60363c43c4578" + integrity sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw== + +"@types/mocha@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" + integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== + +"@types/node@*": + version "16.11.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" + integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== + +"@types/node@^12.12.54": + version "12.20.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" + integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1, base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.0.0, bn.js@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + +borsh@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" + integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== + dependencies: + "@types/bn.js" "^4.11.5" + bn.js "^5.0.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +bs58@^4.0.0, bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +buffer-from@^1.0.0, buffer-from@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-layout@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" + integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== + +buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bufferutil@^4.0.1: + version "4.0.5" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" + integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== + dependencies: + node-gyp-build "^4.3.0" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== + +chai@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + +chokidar@3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +circular-json@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +cross-fetch@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" + integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== + dependencies: + node-fetch "2.6.1" + +crypto-hash@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" + integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== + +debug@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +elliptic@^6.5.2: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eventemitter3@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +jayson@^3.4.4: + version "3.6.5" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.5.tgz#e560bcad4daf098c7391f46ba8efc9d6f34a4102" + integrity sha512-wmOjX+eQcnCDyPF4KORomaIj9wj3h0B5VEbeD0+2VHfTfErB+h1zpR7oBkgCZp36AFjp3+a4CLz6U72BYpFHAw== + dependencies: + "@types/connect" "^3.4.33" + "@types/express-serve-static-core" "^4.17.9" + "@types/lodash" "^4.14.159" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + lodash "^4.17.20" + uuid "^3.4.0" + ws "^7.4.5" + +js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + +js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mkdirp@^0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mocha@^9.0.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.2" + debug "4.3.2" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.7" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "3.0.4" + ms "2.1.3" + nanoid "3.1.25" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.1.5" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@3.1.25: + version "3.1.25" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-fetch@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +pako@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" + integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +rpc-websockets@^7.4.2: + version "7.4.16" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.16.tgz#eb701cdef577d4357ba5f526d50e25f370396fac" + integrity sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ== + dependencies: + "@babel/runtime" "^7.11.2" + circular-json "^0.5.9" + eventemitter3 "^4.0.7" + uuid "^8.3.0" + ws "^7.4.5" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +secp256k1@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" + integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== + dependencies: + elliptic "^6.5.2" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +source-map-support@^0.5.6: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + +traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= + +ts-mocha@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-8.0.0.tgz#962d0fa12eeb6468aa1a6b594bb3bbc818da3ef0" + integrity sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA== + dependencies: + ts-node "7.0.1" + optionalDependencies: + tsconfig-paths "^3.5.0" + +ts-node@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" + integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== + dependencies: + arrify "^1.0.0" + buffer-from "^1.1.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.6" + yn "^2.0.0" + +tsconfig-paths@^3.5.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" + integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^2.0.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + +tweetnacl@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +typescript@^4.3.5: + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== + +utf-8-validate@^5.0.2: + version "5.0.7" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" + integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== + dependencies: + node-gyp-build "^4.3.0" + +uuid@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +workerpool@6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +ws@^7.4.5: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" + integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/ts/src/error.ts b/ts/src/error.ts index b27a31926d..fc1c8c037b 100644 --- a/ts/src/error.ts +++ b/ts/src/error.ts @@ -90,6 +90,7 @@ const LangErrorCode = { AccountNotSigner: 170, AccountNotSystemOwned: 171, AccountNotInitialized: 172, + AccountNotProgramData: 173, // State. StateInvalidAddress: 180, @@ -180,6 +181,10 @@ const LangErrorMessage = new Map([ LangErrorCode.AccountNotInitialized, "The program expected this account to be already initialized", ], + [ + LangErrorCode.AccountNotProgramData, + "The given account is not a program data account" + ], // State. [ From 442efd3a50621424f95ad1a4c02c6ed9868281e3 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 03:37:40 +0100 Subject: [PATCH 02/21] ts: lint --- ts/src/error.ts | 2 +- ts/src/program/index.ts | 10 ++-------- ts/src/program/namespace/account.ts | 7 ++++--- ts/src/program/namespace/types.ts | 10 ++++------ ts/src/utils/common.ts | 7 +++---- 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/ts/src/error.ts b/ts/src/error.ts index fc1c8c037b..d31fa5adca 100644 --- a/ts/src/error.ts +++ b/ts/src/error.ts @@ -183,7 +183,7 @@ const LangErrorMessage = new Map([ ], [ LangErrorCode.AccountNotProgramData, - "The given account is not a program data account" + "The given account is not a program data account", ], // State. diff --git a/ts/src/program/index.ts b/ts/src/program/index.ts index 0316529161..951f0648cd 100644 --- a/ts/src/program/index.ts +++ b/ts/src/program/index.ts @@ -265,14 +265,8 @@ export class Program { this._events = new EventManager(this._programId, provider, this._coder); // Dynamic namespaces. - const [ - rpc, - instruction, - transaction, - account, - simulate, - state, - ] = NamespaceFactory.build(idl, this._coder, programId, provider); + const [rpc, instruction, transaction, account, simulate, state] = + NamespaceFactory.build(idl, this._coder, programId, provider); this.rpc = rpc; this.instruction = instruction; this.transaction = transaction; diff --git a/ts/src/program/namespace/account.ts b/ts/src/program/namespace/account.ts index 9d83b31836..904170624e 100644 --- a/ts/src/program/namespace/account.ts +++ b/ts/src/program/namespace/account.ts @@ -316,9 +316,10 @@ export class AccountClient< fromPubkey: this._provider.wallet.publicKey, newAccountPubkey: signer.publicKey, space: sizeOverride ?? size, - lamports: await this._provider.connection.getMinimumBalanceForRentExemption( - sizeOverride ?? size - ), + lamports: + await this._provider.connection.getMinimumBalanceForRentExemption( + sizeOverride ?? size + ), programId: this._programId, }); } diff --git a/ts/src/program/namespace/types.ts b/ts/src/program/namespace/types.ts index 7d4a3b004b..e753f65cac 100644 --- a/ts/src/program/namespace/types.ts +++ b/ts/src/program/namespace/types.ts @@ -84,10 +84,9 @@ type TypeMap = { bool: boolean; } & { [K in "u8" | "i8" | "u16" | "i16" | "u32" | "i32"]: number; -} & - { - [K in "u64" | "i64" | "u128" | "i128"]: BN; - }; +} & { + [K in "u64" | "i64" | "u128" | "i128"]: BN; +}; export type DecodeType = T extends keyof TypeMap ? TypeMap[T] @@ -108,8 +107,7 @@ type ArgsTuple = { [K in keyof A]: A[K] extends IdlField ? DecodeType : unknown; -} & - unknown[]; +} & unknown[]; type FieldsOfType = NonNullable< I["type"] extends IdlTypeDefTyStruct diff --git a/ts/src/utils/common.ts b/ts/src/utils/common.ts index 3a3cbdf019..6faae25aa3 100644 --- a/ts/src/utils/common.ts +++ b/ts/src/utils/common.ts @@ -13,8 +13,7 @@ export const isBrowser = * @returns A two dimensional array where each T[] length is < the provided size. */ export function chunks(array: T[], size: number): T[][] { - return Array.apply( - 0, - new Array(Math.ceil(array.length / size)) - ).map((_, index) => array.slice(index * size, (index + 1) * size)); + return Array.apply(0, new Array(Math.ceil(array.length / size))).map( + (_, index) => array.slice(index * size, (index + 1) * size) + ); } From 41f5a8787cfb42880c34b5e45c810952af6cb7c4 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 03:45:25 +0100 Subject: [PATCH 03/21] tests: update wallet path --- tests/program-data/Anchor.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/program-data/Anchor.toml b/tests/program-data/Anchor.toml index 10ae0bbe39..ab3c043e4a 100644 --- a/tests/program-data/Anchor.toml +++ b/tests/program-data/Anchor.toml @@ -6,7 +6,7 @@ url = "https://anchor.projectserum.com" [provider] cluster = "localnet" -wallet = "/Users/paul/.config/solana/id.json" +wallet = "~/.config/solana/id.json" [scripts] test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" From 661998b4a25872f4f54a1f2022cfe4e2960c7167 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 04:14:46 +0100 Subject: [PATCH 04/21] tests: fix ci --- .github/workflows/tests.yaml | 4 +--- tests/program-data/program_data-keypair.json | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 tests/program-data/program_data-keypair.json diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3c3786aed6..822864f713 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -215,7 +215,7 @@ jobs: - run: solana-test-validator -r --quiet & name: start validator - - run: cd tests/program-data && anchor build && anchor deploy && anchor test --skip-deploy + - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy test-programs: needs: setup-anchor-cli @@ -262,8 +262,6 @@ jobs: path: tests/ido-pool - cmd: cd tests/cfo && anchor run test-with-build path: tests/cfo - - cmd: cd tests/program-data && anchor test - path: tests/program-data steps: - uses: actions/checkout@v2 - uses: ./.github/actions/setup/ diff --git a/tests/program-data/program_data-keypair.json b/tests/program-data/program_data-keypair.json new file mode 100644 index 0000000000..ae39fe9564 --- /dev/null +++ b/tests/program-data/program_data-keypair.json @@ -0,0 +1 @@ +[114,99,192,17,48,208,90,184,231,46,220,91,47,115,132,253,218,163,228,101,8,121,220,138,41,140,176,127,254,91,51,28,176,244,174,182,223,57,57,125,117,201,31,213,9,39,207,212,100,173,88,252,61,235,89,156,53,86,4,90,16,251,191,219] \ No newline at end of file From 049b3a56e905fbf3c1468643d406852fba89a2fe Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 04:27:50 +0100 Subject: [PATCH 05/21] ts: lint..again? --- ts/src/program/index.ts | 10 ++++++++-- ts/src/program/namespace/account.ts | 7 +++---- ts/src/program/namespace/types.ts | 10 ++++++---- ts/src/utils/common.ts | 7 ++++--- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ts/src/program/index.ts b/ts/src/program/index.ts index 951f0648cd..0316529161 100644 --- a/ts/src/program/index.ts +++ b/ts/src/program/index.ts @@ -265,8 +265,14 @@ export class Program { this._events = new EventManager(this._programId, provider, this._coder); // Dynamic namespaces. - const [rpc, instruction, transaction, account, simulate, state] = - NamespaceFactory.build(idl, this._coder, programId, provider); + const [ + rpc, + instruction, + transaction, + account, + simulate, + state, + ] = NamespaceFactory.build(idl, this._coder, programId, provider); this.rpc = rpc; this.instruction = instruction; this.transaction = transaction; diff --git a/ts/src/program/namespace/account.ts b/ts/src/program/namespace/account.ts index 904170624e..9d83b31836 100644 --- a/ts/src/program/namespace/account.ts +++ b/ts/src/program/namespace/account.ts @@ -316,10 +316,9 @@ export class AccountClient< fromPubkey: this._provider.wallet.publicKey, newAccountPubkey: signer.publicKey, space: sizeOverride ?? size, - lamports: - await this._provider.connection.getMinimumBalanceForRentExemption( - sizeOverride ?? size - ), + lamports: await this._provider.connection.getMinimumBalanceForRentExemption( + sizeOverride ?? size + ), programId: this._programId, }); } diff --git a/ts/src/program/namespace/types.ts b/ts/src/program/namespace/types.ts index e753f65cac..7d4a3b004b 100644 --- a/ts/src/program/namespace/types.ts +++ b/ts/src/program/namespace/types.ts @@ -84,9 +84,10 @@ type TypeMap = { bool: boolean; } & { [K in "u8" | "i8" | "u16" | "i16" | "u32" | "i32"]: number; -} & { - [K in "u64" | "i64" | "u128" | "i128"]: BN; -}; +} & + { + [K in "u64" | "i64" | "u128" | "i128"]: BN; + }; export type DecodeType = T extends keyof TypeMap ? TypeMap[T] @@ -107,7 +108,8 @@ type ArgsTuple = { [K in keyof A]: A[K] extends IdlField ? DecodeType : unknown; -} & unknown[]; +} & + unknown[]; type FieldsOfType = NonNullable< I["type"] extends IdlTypeDefTyStruct diff --git a/ts/src/utils/common.ts b/ts/src/utils/common.ts index 6faae25aa3..3a3cbdf019 100644 --- a/ts/src/utils/common.ts +++ b/ts/src/utils/common.ts @@ -13,7 +13,8 @@ export const isBrowser = * @returns A two dimensional array where each T[] length is < the provided size. */ export function chunks(array: T[], size: number): T[][] { - return Array.apply(0, new Array(Math.ceil(array.length / size))).map( - (_, index) => array.slice(index * size, (index + 1) * size) - ); + return Array.apply( + 0, + new Array(Math.ceil(array.length / size)) + ).map((_, index) => array.slice(index * size, (index + 1) * size)); } From 558462f660ca02c20af19b325ed83a0552347830 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 04:39:30 +0100 Subject: [PATCH 06/21] ci: fix ci --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 822864f713..e3c8d2b700 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -215,6 +215,7 @@ jobs: - run: solana-test-validator -r --quiet & name: start validator + - run: solana airdrop 10 - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy test-programs: From 998e3c812e5cf7cf8d9f01e9c81752b3079f24fd Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 04:49:01 +0100 Subject: [PATCH 07/21] ci: still fixing --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e3c8d2b700..ddd8b5c7da 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -215,7 +215,7 @@ jobs: - run: solana-test-validator -r --quiet & name: start validator - - run: solana airdrop 10 + - run: sleep 5 && solana airdrop 10 - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy test-programs: From 585a0c87fab1f05394a6756f47f9e84fad5451ee Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 05:25:40 +0100 Subject: [PATCH 08/21] ci wip --- .github/workflows/tests.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ddd8b5c7da..2a61c0ae2e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -215,7 +215,9 @@ jobs: - run: solana-test-validator -r --quiet & name: start validator - - run: sleep 5 && solana airdrop 10 + - run: solana address + - run: solana balance + - run: solana airdrop 3 ~/.config/solana/id.json - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy test-programs: From 6dc36786291d19a95d5a9a99613fc2d276d090f7 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 05:36:34 +0100 Subject: [PATCH 09/21] ci: fix --- .github/actions/setup-solana/action.yaml | 2 ++ .github/workflows/tests.yaml | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-solana/action.yaml b/.github/actions/setup-solana/action.yaml index c0ab16ed62..f24aa48687 100644 --- a/.github/actions/setup-solana/action.yaml +++ b/.github/actions/setup-solana/action.yaml @@ -17,3 +17,5 @@ runs: shell: bash - run: solana-keygen new --no-bip39-passphrase shell: bash + - run: solana config set --url localhost + shell: bash diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2a61c0ae2e..822864f713 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -215,9 +215,6 @@ jobs: - run: solana-test-validator -r --quiet & name: start validator - - run: solana address - - run: solana balance - - run: solana airdrop 3 ~/.config/solana/id.json - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy test-programs: From ec1dbd86def2cb3971671f24cf7261f7471d132f Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 06:03:18 +0100 Subject: [PATCH 10/21] ci: fix --- .github/workflows/tests.yaml | 4 +++- tests/yarn.lock | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 822864f713..31d159ce0c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -215,7 +215,9 @@ jobs: - run: solana-test-validator -r --quiet & name: start validator - - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy + - run: cd tests/program-data && yarn + - run: cd tests/program-data && yarn link @project-serum/anchor + - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy --skip-build test-programs: needs: setup-anchor-cli diff --git a/tests/yarn.lock b/tests/yarn.lock index 78c29e3156..5528c10cd6 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -50,10 +50,10 @@ snake-case "^3.0.4" toml "^3.0.0" -"@project-serum/anchor@^0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.18.0.tgz#867144282e59482230f797f73ee9f5634f846061" - integrity sha512-WTm+UB93MoxyCbjnHIibv/uUEoO/5gL4GEtE/aMioLF8Z4i0vCMPnvAN0xpk9VBu3t7ld2DcCE/L+6Z7dwU++w== +"@project-serum/anchor@^0.18.2": + version "0.18.2" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.18.2.tgz#0f13b5c2046446b7c24cf28763eec90febb28485" + integrity sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ== dependencies: "@project-serum/borsh" "^0.2.2" "@solana/web3.js" "^1.17.0" From ba0a0b746018c690a24235339cbf99fc9ae723cc Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 06:33:31 +0100 Subject: [PATCH 11/21] ci: fix --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 31d159ce0c..f7574d839a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -217,7 +217,7 @@ jobs: name: start validator - run: cd tests/program-data && yarn - run: cd tests/program-data && yarn link @project-serum/anchor - - run: cd tests/program-data && anchor build && solana program deploy --program-id program_data-keypair.json target/deploy/program_data.so && anchor test --skip-deploy --skip-build + - run: cd tests/program-data && anchor build && mv program_data-keypair.json target/deploy/program_data-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build test-programs: needs: setup-anchor-cli From fa06d6d7aafbf1b02c11dd627aa092b929147c54 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 06:55:36 +0100 Subject: [PATCH 12/21] lang: add owned by bpf error, docs: changelog --- CHANGELOG.md | 1 + lang/src/error.rs | 2 ++ lang/src/program_data.rs | 10 ++-------- tests/program-data/tests/program-data.ts | 24 ++++++++++++++++++++++++ ts/src/error.ts | 5 +++++ 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edd2809af2..32d5fffef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ incremented for features. * lang: Add `ErrorCode::AccountNotInitialized` error to separate the situation when the account has the wrong owner from when it does not exist (#[1024](https://github.com/project-serum/anchor/pull/1024)) * lang: Called instructions now log their name by default. This can be turned off with the `no-log-ix-name` flag ([#1057](https://github.com/project-serum/anchor/pull/1057)) +* lang: Add `ProgramData` AccountInfo wrapper that checks that given AccountInfo is owned by the upgradable loader and that its deserialization is the `ProgramData` variant of [UpgradeableLoaderState](https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html) ([#1095](https://github.com/project-serum/anchor/pull/1095)) ## [0.18.2] - 2021-11-14 diff --git a/lang/src/error.rs b/lang/src/error.rs index 70a7ca977e..e8df427550 100644 --- a/lang/src/error.rs +++ b/lang/src/error.rs @@ -78,6 +78,8 @@ pub enum ErrorCode { AccountNotInitialized, #[msg("The given account is not a program data account")] AccountNotProgramData, + #[msg("The given account is not owned by the upgradable BPF loader")] + AccountNotUpgradableBPFOwned, // State. #[msg("The given state account does not have the correct address")] diff --git a/lang/src/program_data.rs b/lang/src/program_data.rs index 311d000e9b..c784e50318 100644 --- a/lang/src/program_data.rs +++ b/lang/src/program_data.rs @@ -24,12 +24,6 @@ impl ProgramDataInner { } } -impl Owner for ProgramDataInner { - fn owner() -> Pubkey { - bpf_loader_upgradeable::ID - } -} - #[derive(Debug, Clone)] pub struct ProgramData<'info> { program_data_inner: ProgramDataInner, @@ -46,8 +40,8 @@ impl<'info> ProgramData<'info> { #[inline(never)] pub fn try_from(info: &AccountInfo<'info>) -> Result, ProgramError> { - if *info.owner != ProgramDataInner::owner() { - return Err(ErrorCode::AccountNotProgramOwned.into()); + if *info.owner != bpf_loader_upgradeable::ID { + return Err(ErrorCode::AccountNotUpgradableBPFOwned.into()); } let program_state: bpf_loader_upgradeable::UpgradeableLoaderState = bincode::deserialize(&info.try_borrow_data()?) diff --git a/tests/program-data/tests/program-data.ts b/tests/program-data/tests/program-data.ts index f714d15b85..d0b79e5ed2 100644 --- a/tests/program-data/tests/program-data.ts +++ b/tests/program-data/tests/program-data.ts @@ -79,4 +79,28 @@ describe('program-data', () => { assert.equal(err.msg, "The given account is not a program data account"); } }); + + it('Validates that account is owned by the upgradable bpf loader', async () => { + const settings = anchor.web3.Keypair.generate(); + try { + const authority = anchor.web3.Keypair.generate(); + await provider.connection.confirmTransaction( + await provider.connection.requestAirdrop(authority.publicKey, 10000000000), + "confirmed" + ); + await program.rpc.setAdminSettings(new anchor.BN(500), { + accounts: { + authority: authority.publicKey, + systemProgram: anchor.web3.SystemProgram.programId, + programData: authority.publicKey, + settings: settings.publicKey + }, + signers: [settings, authority] + }); + assert.ok(false); + } catch (err) { + assert.equal(err.code, 174); + assert.equal(err.msg, "The given account is not owned by the upgradable BPF loader"); + } + }); }); diff --git a/ts/src/error.ts b/ts/src/error.ts index d31fa5adca..174ddaa20b 100644 --- a/ts/src/error.ts +++ b/ts/src/error.ts @@ -91,6 +91,7 @@ const LangErrorCode = { AccountNotSystemOwned: 171, AccountNotInitialized: 172, AccountNotProgramData: 173, + AccountNotUpgradableBPFOwned: 174, // State. StateInvalidAddress: 180, @@ -185,6 +186,10 @@ const LangErrorMessage = new Map([ LangErrorCode.AccountNotProgramData, "The given account is not a program data account", ], + [ + LangErrorCode.AccountNotUpgradableBPFOwned, + "The given account is not owned by the upgradable BPF loader" + ], // State. [ From f4497f2587d80020f69134eeafa89351c37d21eb Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 07:00:42 +0100 Subject: [PATCH 13/21] ts: lint --- ts/src/error.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/src/error.ts b/ts/src/error.ts index 174ddaa20b..e1b16084e5 100644 --- a/ts/src/error.ts +++ b/ts/src/error.ts @@ -188,7 +188,7 @@ const LangErrorMessage = new Map([ ], [ LangErrorCode.AccountNotUpgradableBPFOwned, - "The given account is not owned by the upgradable BPF loader" + "The given account is not owned by the upgradable BPF loader", ], // State. From 67dc5cf7e75aaada543934db0d9cf151a05dc160 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Fri, 3 Dec 2021 07:19:29 +0100 Subject: [PATCH 14/21] tests: remove lock file --- tests/program-data/yarn.lock | 1202 ---------------------------------- 1 file changed, 1202 deletions(-) delete mode 100644 tests/program-data/yarn.lock diff --git a/tests/program-data/yarn.lock b/tests/program-data/yarn.lock deleted file mode 100644 index 1c582e8837..0000000000 --- a/tests/program-data/yarn.lock +++ /dev/null @@ -1,1202 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" - integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== - dependencies: - regenerator-runtime "^0.13.4" - -"@ethersproject/bytes@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/logger@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== - -"@ethersproject/sha2@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" - integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - hash.js "1.1.7" - -"@project-serum/anchor@^0.18.2": - version "0.18.2" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.18.2.tgz#0f13b5c2046446b7c24cf28763eec90febb28485" - integrity sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ== - dependencies: - "@project-serum/borsh" "^0.2.2" - "@solana/web3.js" "^1.17.0" - base64-js "^1.5.1" - bn.js "^5.1.2" - bs58 "^4.0.1" - buffer-layout "^1.2.0" - camelcase "^5.3.1" - crypto-hash "^1.3.0" - eventemitter3 "^4.0.7" - find "^0.3.0" - js-sha256 "^0.9.0" - pako "^2.0.3" - snake-case "^3.0.4" - toml "^3.0.0" - -"@project-serum/borsh@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.2.tgz#63e558f2d6eb6ab79086bf499dea94da3182498f" - integrity sha512-Ms+aWmGVW6bWd3b0+MWwoaYig2QD0F90h0uhr7AzY3dpCb5e2S6RsRW02vFTfa085pY2VLB7nTZNbFECQ1liTg== - dependencies: - bn.js "^5.1.2" - buffer-layout "^1.2.0" - -"@solana/buffer-layout@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" - integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== - dependencies: - buffer "~6.0.3" - -"@solana/web3.js@^1.17.0": - version "1.31.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.31.0.tgz#7a313d4c1a90b77f27ddbfe845a10d6883e06452" - integrity sha512-7nHHx1JNFnrt15e9y8m38I/EJCbaB+bFC3KZVM1+QhybCikFxGMtGA5r7PDC3GEL1R2RZA8yKoLkDKo3vzzqnw== - dependencies: - "@babel/runtime" "^7.12.5" - "@ethersproject/sha2" "^5.5.0" - "@solana/buffer-layout" "^3.0.0" - bn.js "^5.0.0" - borsh "^0.4.0" - bs58 "^4.0.1" - buffer "6.0.1" - cross-fetch "^3.1.4" - jayson "^3.4.4" - js-sha3 "^0.8.0" - rpc-websockets "^7.4.2" - secp256k1 "^4.0.2" - superstruct "^0.14.2" - tweetnacl "^1.0.0" - -"@types/bn.js@^4.11.5": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/connect@^3.4.33": - version "3.4.35" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== - dependencies: - "@types/node" "*" - -"@types/express-serve-static-core@^4.17.9": - version "4.17.26" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz#5d9a8eeecb9d5f9d7fc1d85f541512a84638ae88" - integrity sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - -"@types/lodash@^4.14.159": - version "4.14.177" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.177.tgz#f70c0d19c30fab101cad46b52be60363c43c4578" - integrity sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw== - -"@types/mocha@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" - integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== - -"@types/node@*": - version "16.11.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" - integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== - -"@types/node@^12.12.54": - version "12.20.37" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" - integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== - -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/ws@^7.4.4": - version "7.4.7" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" - integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== - dependencies: - "@types/node" "*" - -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - -JSONStream@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-x@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.3.1, base64-js@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.0.0, bn.js@^5.1.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -borsh@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" - integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== - dependencies: - "@types/bn.js" "^4.11.5" - bn.js "^5.0.0" - bs58 "^4.0.0" - text-encoding-utf-8 "^1.0.2" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -bs58@^4.0.0, bs58@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= - dependencies: - base-x "^3.0.2" - -buffer-from@^1.0.0, buffer-from@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-layout@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" - integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== - -buffer@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" - integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -buffer@~6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -bufferutil@^4.0.1: - version "4.0.5" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" - integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== - dependencies: - node-gyp-build "^4.3.0" - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" - integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== - -chai@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.1" - type-detect "^4.0.5" - -chalk@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -chokidar@3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -circular-json@^0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" - integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -commander@^2.20.3: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -cross-fetch@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== - dependencies: - node-fetch "2.6.1" - -crypto-hash@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" - integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== - -debug@4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -delay@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" - integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== - -diff@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - -diff@^3.1.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -dot-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" - integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - -elliptic@^6.5.2: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -eyes@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" - integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" - integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== - dependencies: - traverse-chain "~0.1.0" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.1.7: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isomorphic-ws@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" - integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== - -jayson@^3.4.4: - version "3.6.5" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.5.tgz#e560bcad4daf098c7391f46ba8efc9d6f34a4102" - integrity sha512-wmOjX+eQcnCDyPF4KORomaIj9wj3h0B5VEbeD0+2VHfTfErB+h1zpR7oBkgCZp36AFjp3+a4CLz6U72BYpFHAw== - dependencies: - "@types/connect" "^3.4.33" - "@types/express-serve-static-core" "^4.17.9" - "@types/lodash" "^4.14.159" - "@types/node" "^12.12.54" - "@types/ws" "^7.4.4" - JSONStream "^1.3.5" - commander "^2.20.3" - delay "^5.0.0" - es6-promisify "^5.0.0" - eyes "^0.1.8" - isomorphic-ws "^4.0.1" - json-stringify-safe "^5.0.1" - lodash "^4.17.20" - uuid "^3.4.0" - ws "^7.4.5" - -js-sha256@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== - -js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.17.20: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -lower-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" - integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== - dependencies: - tslib "^2.0.3" - -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mocha@^9.0.3: - version "9.1.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" - integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.2" - debug "4.3.2" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.1.7" - growl "1.10.5" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "3.0.4" - ms "2.1.3" - nanoid "3.1.25" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - which "2.0.2" - workerpool "6.1.5" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -nanoid@3.1.25: - version "3.1.25" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" - integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== - -no-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" - integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== - dependencies: - lower-case "^2.0.2" - tslib "^2.0.3" - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -pako@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" - integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -rpc-websockets@^7.4.2: - version "7.4.16" - resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.16.tgz#eb701cdef577d4357ba5f526d50e25f370396fac" - integrity sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ== - dependencies: - "@babel/runtime" "^7.11.2" - circular-json "^0.5.9" - eventemitter3 "^4.0.7" - uuid "^8.3.0" - ws "^7.4.5" - optionalDependencies: - bufferutil "^4.0.1" - utf-8-validate "^5.0.2" - -safe-buffer@^5.0.1, safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -secp256k1@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" - integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== - dependencies: - elliptic "^6.5.2" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -serialize-javascript@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - -snake-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" - integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - -source-map-support@^0.5.6: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-json-comments@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -superstruct@^0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" - integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== - -supports-color@8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -text-encoding-utf-8@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" - integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== - -"through@>=2.2.7 <3": - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toml@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" - integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== - -traverse-chain@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" - integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= - -ts-mocha@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-8.0.0.tgz#962d0fa12eeb6468aa1a6b594bb3bbc818da3ef0" - integrity sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA== - dependencies: - ts-node "7.0.1" - optionalDependencies: - tsconfig-paths "^3.5.0" - -ts-node@7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" - integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== - dependencies: - arrify "^1.0.0" - buffer-from "^1.1.0" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.5.6" - yn "^2.0.0" - -tsconfig-paths@^3.5.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" - integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" - strip-bom "^3.0.0" - -tslib@^2.0.3: - version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== - -tweetnacl@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -typescript@^4.3.5: - version "4.5.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" - integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== - -utf-8-validate@^5.0.2: - version "5.0.7" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" - integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== - dependencies: - node-gyp-build "^4.3.0" - -uuid@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -uuid@^8.3.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -which@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -workerpool@6.1.5: - version "6.1.5" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" - integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^7.4.5: - version "7.5.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" - integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" - integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 939e06406b20f1e7b101b4bc8b90cf307d9b6aec Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sat, 4 Dec 2021 15:59:39 +0100 Subject: [PATCH 15/21] lang: use Account<'info, ProgramData> instead of its own ProgramData type --- .github/workflows/tests.yaml | 2 +- Cargo.lock | 6 +- lang/src/bpf_upgradable.rs | 85 +++++++++++ lang/src/error.rs | 4 +- lang/src/lib.rs | 8 +- lang/src/program_data.rs | 143 ------------------ .../programs/program-data/src/lib.rs | 4 +- tests/program-data/tests/program-data.ts | 4 +- 8 files changed, 99 insertions(+), 157 deletions(-) create mode 100644 lang/src/bpf_upgradable.rs delete mode 100644 lang/src/program_data.rs diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f7574d839a..f61e953865 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -217,7 +217,7 @@ jobs: name: start validator - run: cd tests/program-data && yarn - run: cd tests/program-data && yarn link @project-serum/anchor - - run: cd tests/program-data && anchor build && mv program_data-keypair.json target/deploy/program_data-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build + - run: cd tests/program-data && anchor build && cp program_data-keypair.json target/deploy/program_data-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build test-programs: needs: setup-anchor-cli diff --git a/Cargo.lock b/Cargo.lock index 63044db55e..4e16d8501d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,11 +81,11 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.18.0" +version = "0.18.2" dependencies = [ "anchor-syn", - "proc-macro2 1.0.29", - "syn 1.0.75", + "proc-macro2 1.0.32", + "syn 1.0.81", ] [[package]] diff --git a/lang/src/bpf_upgradable.rs b/lang/src/bpf_upgradable.rs new file mode 100644 index 0000000000..6805000182 --- /dev/null +++ b/lang/src/bpf_upgradable.rs @@ -0,0 +1,85 @@ +use crate::{AccountDeserialize, AccountSerialize, Owner}; +use solana_program::{ + bpf_loader_upgradeable::{self, UpgradeableLoaderState}, + program_error::ProgramError, + pubkey::Pubkey, +}; + +#[derive(Clone)] +pub struct ProgramData { + pub slot: u64, + pub upgrade_authority_address: Option, +} + +impl AccountDeserialize for ProgramData { + fn try_deserialize( + buf: &mut &[u8], + ) -> Result { + ProgramData::try_deserialize_unchecked(buf) + } + + fn try_deserialize_unchecked( + buf: &mut &[u8], + ) -> Result { + let program_state: bpf_loader_upgradeable::UpgradeableLoaderState = + bincode::deserialize(buf).map_err(|_| ProgramError::InvalidAccountData)?; + + match program_state { + UpgradeableLoaderState::Uninitialized => { + Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()) + } + UpgradeableLoaderState::Buffer { + authority_address: _, + } => Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()), + UpgradeableLoaderState::Program { + programdata_address: _, + } => Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()), + UpgradeableLoaderState::ProgramData { + slot, + upgrade_authority_address, + } => Ok(ProgramData { + slot, + upgrade_authority_address, + }), + } + } +} + +impl AccountSerialize for ProgramData { + fn try_serialize( + &self, + _writer: &mut W, + ) -> Result<(), solana_program::program_error::ProgramError> { + // no-op + Ok(()) + } +} + +impl Owner for ProgramData { + fn owner() -> solana_program::pubkey::Pubkey { + anchor_lang::solana_program::bpf_loader_upgradeable::ID + } +} + +impl Owner for UpgradeableLoaderState { + fn owner() -> Pubkey { + anchor_lang::solana_program::bpf_loader_upgradeable::ID + } +} + +impl AccountSerialize for UpgradeableLoaderState { + fn try_serialize(&self, _writer: &mut W) -> Result<(), ProgramError> { + // no-op + Ok(()) + } +} + +impl AccountDeserialize for UpgradeableLoaderState { + fn try_deserialize(buf: &mut &[u8]) -> Result { + UpgradeableLoaderState::try_deserialize_unchecked(buf) + } + + fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result { + bincode::deserialize(buf).map_err(|_| ProgramError::InvalidAccountData) + } +} diff --git a/lang/src/error.rs b/lang/src/error.rs index e8df427550..c49641a45f 100644 --- a/lang/src/error.rs +++ b/lang/src/error.rs @@ -78,8 +78,8 @@ pub enum ErrorCode { AccountNotInitialized, #[msg("The given account is not a program data account")] AccountNotProgramData, - #[msg("The given account is not owned by the upgradable BPF loader")] - AccountNotUpgradableBPFOwned, + #[msg("The given account is not a program")] + AccountNotProgram, // State. #[msg("The given state account does not have the correct address")] diff --git a/lang/src/lib.rs b/lang/src/lib.rs index 8b79ca649e..6b79ba7dcc 100644 --- a/lang/src/lib.rs +++ b/lang/src/lib.rs @@ -35,6 +35,7 @@ mod account; mod account_info; mod account_meta; mod boxed; +mod bpf_upgradable; mod common; mod context; mod cpi_account; @@ -47,7 +48,6 @@ mod loader; mod loader_account; mod program; mod program_account; -mod program_data; mod signer; pub mod state; mod system_account; @@ -57,6 +57,7 @@ mod unchecked_account; mod vec; pub use crate::account::Account; +pub use crate::bpf_upgradable::*; #[doc(hidden)] #[allow(deprecated)] pub use crate::context::CpiStateContext; @@ -74,7 +75,6 @@ pub use crate::program::Program; #[doc(hidden)] #[allow(deprecated)] pub use crate::program_account::ProgramAccount; -pub use crate::program_data::*; pub use crate::signer::Signer; #[doc(hidden)] #[allow(deprecated)] @@ -256,8 +256,8 @@ pub mod prelude { access_control, account, constant, declare_id, emit, error, event, interface, program, require, state, zero_copy, Account, AccountDeserialize, AccountLoader, AccountSerialize, Accounts, AccountsExit, AnchorDeserialize, AnchorSerialize, Context, CpiContext, Id, Key, - Owner, Program, Signer, System, SystemAccount, Sysvar, ToAccountInfo, ToAccountInfos, - ToAccountMetas, UncheckedAccount, ProgramData, ProgramDataInner + Owner, Program, ProgramData, Signer, System, SystemAccount, Sysvar, ToAccountInfo, + ToAccountInfos, ToAccountMetas, UncheckedAccount, }; #[allow(deprecated)] diff --git a/lang/src/program_data.rs b/lang/src/program_data.rs deleted file mode 100644 index c784e50318..0000000000 --- a/lang/src/program_data.rs +++ /dev/null @@ -1,143 +0,0 @@ -use crate::error::ErrorCode; -use crate::*; -use solana_program::bpf_loader_upgradeable; -use solana_program::entrypoint::ProgramResult; -use solana_program::instruction::AccountMeta; -use solana_program::program_error::ProgramError; -use solana_program::pubkey::Pubkey; -use solana_program::{account_info::AccountInfo, bpf_loader_upgradeable::UpgradeableLoaderState}; -use std::ops::Deref; - -#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize)] -pub struct ProgramDataInner { - slot: u64, - upgrade_authority_address: Option, -} - -impl ProgramDataInner { - pub fn slot(&self) -> &u64 { - &self.slot - } - - pub fn upgrade_authority_address(&self) -> &Option { - &self.upgrade_authority_address - } -} - -#[derive(Debug, Clone)] -pub struct ProgramData<'info> { - program_data_inner: ProgramDataInner, - info: AccountInfo<'info>, -} - -impl<'info> ProgramData<'info> { - fn new(info: AccountInfo<'info>, program_data_inner: ProgramDataInner) -> ProgramData<'info> { - Self { - info, - program_data_inner, - } - } - - #[inline(never)] - pub fn try_from(info: &AccountInfo<'info>) -> Result, ProgramError> { - if *info.owner != bpf_loader_upgradeable::ID { - return Err(ErrorCode::AccountNotUpgradableBPFOwned.into()); - } - let program_state: bpf_loader_upgradeable::UpgradeableLoaderState = - bincode::deserialize(&info.try_borrow_data()?) - .map_err(|_| ProgramError::InvalidAccountData)?; - match program_state { - UpgradeableLoaderState::Uninitialized => { - Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()) - } - UpgradeableLoaderState::Buffer { - authority_address: _, - } => Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()), - UpgradeableLoaderState::Program { - programdata_address: _, - } => Err(anchor_lang::error::ErrorCode::AccountNotProgramData.into()), - UpgradeableLoaderState::ProgramData { - slot, - upgrade_authority_address, - } => Ok(ProgramData::new( - info.clone(), - ProgramDataInner { - slot, - upgrade_authority_address, - }, - )), - } - } -} - -impl<'info> Accounts<'info> for ProgramData<'info> { - #[inline(never)] - fn try_accounts( - _program_id: &Pubkey, - accounts: &mut &[AccountInfo<'info>], - _ix_data: &[u8], - ) -> Result { - if accounts.is_empty() { - return Err(ErrorCode::AccountNotEnoughKeys.into()); - } - let account = &accounts[0]; - *accounts = &accounts[1..]; - ProgramData::try_from(account) - } -} - -impl<'info> AccountsExit<'info> for ProgramData<'info> { - fn exit(&self, _program_id: &Pubkey) -> ProgramResult { - // No-op. - Ok(()) - } -} - -impl<'info> ToAccountMetas for ProgramData<'info> { - fn to_account_metas(&self, is_signer: Option) -> Vec { - let is_signer = is_signer.unwrap_or(self.info.is_signer); - let meta = match self.info.is_writable { - false => AccountMeta::new_readonly(*self.info.key, is_signer), - true => AccountMeta::new(*self.info.key, is_signer), - }; - vec![meta] - } -} - -impl<'info> ToAccountInfos<'info> for ProgramData<'info> { - fn to_account_infos(&self) -> Vec> { - vec![self.info.clone()] - } -} - -impl<'info> ToAccountInfo<'info> for ProgramData<'info> { - fn to_account_info(&self) -> AccountInfo<'info> { - self.info.clone() - } -} - -impl<'info> AsRef> for ProgramData<'info> { - fn as_ref(&self) -> &AccountInfo<'info> { - &self.info - } -} - -impl<'info> AsRef for ProgramData<'info> { - fn as_ref(&self) -> &ProgramDataInner { - &self.program_data_inner - } -} - -impl<'info> Deref for ProgramData<'info> { - type Target = ProgramDataInner; - - fn deref(&self) -> &Self::Target { - &self.program_data_inner - } -} - -impl<'info> Key for ProgramData<'info> { - fn key(&self) -> Pubkey { - *self.info.key - } -} diff --git a/tests/program-data/programs/program-data/src/lib.rs b/tests/program-data/programs/program-data/src/lib.rs index 78ecf0912d..573a1358cf 100644 --- a/tests/program-data/programs/program-data/src/lib.rs +++ b/tests/program-data/programs/program-data/src/lib.rs @@ -26,7 +26,7 @@ pub struct SetAdminSettings<'info> { pub settings: Account<'info, Settings>, #[account(mut)] pub authority: Signer<'info>, - #[account(constraint = *program_data.upgrade_authority_address() == Some(authority.key()))] - pub program_data: ProgramData<'info>, + #[account(constraint = program_data.upgrade_authority_address == Some(authority.key()))] + pub program_data: Account<'info, ProgramData>, pub system_program: Program<'info, System> } diff --git a/tests/program-data/tests/program-data.ts b/tests/program-data/tests/program-data.ts index d0b79e5ed2..b62c0fb8a5 100644 --- a/tests/program-data/tests/program-data.ts +++ b/tests/program-data/tests/program-data.ts @@ -99,8 +99,8 @@ describe('program-data', () => { }); assert.ok(false); } catch (err) { - assert.equal(err.code, 174); - assert.equal(err.msg, "The given account is not owned by the upgradable BPF loader"); + assert.equal(err.code, 167); + assert.equal(err.msg, "The given account is not owned by the executing program"); } }); }); From c4fc8507c18d1c86e436182e72f10603ff0bb202 Mon Sep 17 00:00:00 2001 From: Armani Ferrante Date: Sat, 4 Dec 2021 16:38:42 -0500 Subject: [PATCH 16/21] Update tests/program-data/.gitignore --- tests/program-data/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/program-data/.gitignore b/tests/program-data/.gitignore index 51448d4dab..a21fd0f081 100644 --- a/tests/program-data/.gitignore +++ b/tests/program-data/.gitignore @@ -1,4 +1,3 @@ - .anchor .DS_Store target From 1303df12562a8c4420a3d4efadfa973d35a0f196 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sat, 4 Dec 2021 23:17:46 +0100 Subject: [PATCH 17/21] tests: adjusted gitignore --- tests/program-data/.gitignore | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/program-data/.gitignore b/tests/program-data/.gitignore index a21fd0f081..8ee01d321b 100644 --- a/tests/program-data/.gitignore +++ b/tests/program-data/.gitignore @@ -1,5 +1 @@ -.anchor -.DS_Store -target -**/*.rs.bk -node_modules +yarn.lock From a4d5833503c52f839a01e57ad4b99fa6fa48352c Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sat, 4 Dec 2021 23:21:04 +0100 Subject: [PATCH 18/21] lang: refactor bpf_upgradable --- lang/src/bpf_upgradable.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lang/src/bpf_upgradable.rs b/lang/src/bpf_upgradable.rs index 6805000182..d849798e93 100644 --- a/lang/src/bpf_upgradable.rs +++ b/lang/src/bpf_upgradable.rs @@ -1,8 +1,6 @@ use crate::{AccountDeserialize, AccountSerialize, Owner}; use solana_program::{ - bpf_loader_upgradeable::{self, UpgradeableLoaderState}, - program_error::ProgramError, - pubkey::Pubkey, + bpf_loader_upgradeable::UpgradeableLoaderState, program_error::ProgramError, pubkey::Pubkey, }; #[derive(Clone)] @@ -21,8 +19,7 @@ impl AccountDeserialize for ProgramData { fn try_deserialize_unchecked( buf: &mut &[u8], ) -> Result { - let program_state: bpf_loader_upgradeable::UpgradeableLoaderState = - bincode::deserialize(buf).map_err(|_| ProgramError::InvalidAccountData)?; + let program_state = AccountDeserialize::try_deserialize_unchecked(buf)?; match program_state { UpgradeableLoaderState::Uninitialized => { From aba140249e15d0ba0bf117b9831a4ca9b4a6e59e Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sun, 5 Dec 2021 01:28:46 +0100 Subject: [PATCH 19/21] rename program-data to bpf-upgradable-state --- .github/workflows/tests.yaml | 16 ++++++++-------- ...bpf_upgradable.rs => bpf_upgradable_state.rs} | 0 lang/src/lib.rs | 13 +++++++------ .../.gitignore | 0 .../Anchor.toml | 2 +- .../Cargo.toml | 0 .../bpf_upgradable_state-keypair.json} | 0 .../migrations/deploy.ts | 0 .../package.json | 0 .../programs/bpf-upgradable-state}/Cargo.toml | 4 ++-- .../programs/bpf-upgradable-state}/Xargo.toml | 0 .../programs/bpf-upgradable-state}/src/lib.rs | 2 +- .../tests/bpf-upgradable-state.ts} | 7 +++---- .../tsconfig.json | 0 14 files changed, 22 insertions(+), 22 deletions(-) rename lang/src/{bpf_upgradable.rs => bpf_upgradable_state.rs} (100%) rename tests/{program-data => bpf-upgradable-state}/.gitignore (100%) rename tests/{program-data => bpf-upgradable-state}/Anchor.toml (76%) rename tests/{program-data => bpf-upgradable-state}/Cargo.toml (100%) rename tests/{program-data/program_data-keypair.json => bpf-upgradable-state/bpf_upgradable_state-keypair.json} (100%) rename tests/{program-data => bpf-upgradable-state}/migrations/deploy.ts (100%) rename tests/{program-data => bpf-upgradable-state}/package.json (100%) rename tests/{program-data/programs/program-data => bpf-upgradable-state/programs/bpf-upgradable-state}/Cargo.toml (81%) rename tests/{program-data/programs/program-data => bpf-upgradable-state/programs/bpf-upgradable-state}/Xargo.toml (100%) rename tests/{program-data/programs/program-data => bpf-upgradable-state/programs/bpf-upgradable-state}/src/lib.rs (96%) rename tests/{program-data/tests/program-data.ts => bpf-upgradable-state/tests/bpf-upgradable-state.ts} (94%) rename tests/{program-data => bpf-upgradable-state}/tsconfig.json (100%) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f61e953865..371235baad 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -179,9 +179,9 @@ jobs: - uses: ./.github/actions/setup-solana/ - run: cd client/example && ./run-test.sh - test-program-data: + test-bpf-upgradable-state: needs: setup-anchor-cli - name: Test tests/program-data + name: Test tests/bpf-upgradable-state runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 @@ -207,17 +207,17 @@ jobs: path: ~/.cargo/bin/ - uses: actions/cache@v2 - name: Cache tests/program-data target + name: Cache tests/bpf-upgradable-state target id: cache-test-target with: - path: tests/program-data/target - key: cargo-${{ runner.os }}-tests/program-data-${{ env.ANCHOR_VERSION }} + path: tests/bpf-upgradable-state/target + key: cargo-${{ runner.os }}-tests/bpf-upgradable-state-${{ env.ANCHOR_VERSION }} - run: solana-test-validator -r --quiet & name: start validator - - run: cd tests/program-data && yarn - - run: cd tests/program-data && yarn link @project-serum/anchor - - run: cd tests/program-data && anchor build && cp program_data-keypair.json target/deploy/program_data-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build + - run: cd tests/bpf-upgradable-state && yarn + - run: cd tests/bpf-upgradable-state && yarn link @project-serum/anchor + - run: cd tests/bpf-upgradable-state && anchor build && cp bpf_upgradable_state-keypair.json target/deploy/bpf_upgradable_state-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build test-programs: needs: setup-anchor-cli diff --git a/lang/src/bpf_upgradable.rs b/lang/src/bpf_upgradable_state.rs similarity index 100% rename from lang/src/bpf_upgradable.rs rename to lang/src/bpf_upgradable_state.rs diff --git a/lang/src/lib.rs b/lang/src/lib.rs index 6b79ba7dcc..807aa63423 100644 --- a/lang/src/lib.rs +++ b/lang/src/lib.rs @@ -35,7 +35,7 @@ mod account; mod account_info; mod account_meta; mod boxed; -mod bpf_upgradable; +mod bpf_upgradable_state; mod common; mod context; mod cpi_account; @@ -57,7 +57,7 @@ mod unchecked_account; mod vec; pub use crate::account::Account; -pub use crate::bpf_upgradable::*; +pub use crate::bpf_upgradable_state::*; #[doc(hidden)] #[allow(deprecated)] pub use crate::context::CpiStateContext; @@ -254,10 +254,11 @@ impl Key for Pubkey { pub mod prelude { pub use super::{ access_control, account, constant, declare_id, emit, error, event, interface, program, - require, state, zero_copy, Account, AccountDeserialize, AccountLoader, AccountSerialize, - Accounts, AccountsExit, AnchorDeserialize, AnchorSerialize, Context, CpiContext, Id, Key, - Owner, Program, ProgramData, Signer, System, SystemAccount, Sysvar, ToAccountInfo, - ToAccountInfos, ToAccountMetas, UncheckedAccount, + require, solana_program::bpf_loader_upgradeable::UpgradeableLoaderState, state, zero_copy, + Account, AccountDeserialize, AccountLoader, AccountSerialize, Accounts, AccountsExit, + AnchorDeserialize, AnchorSerialize, Context, CpiContext, Id, Key, Owner, Program, + ProgramData, Signer, System, SystemAccount, Sysvar, ToAccountInfo, ToAccountInfos, + ToAccountMetas, UncheckedAccount, }; #[allow(deprecated)] diff --git a/tests/program-data/.gitignore b/tests/bpf-upgradable-state/.gitignore similarity index 100% rename from tests/program-data/.gitignore rename to tests/bpf-upgradable-state/.gitignore diff --git a/tests/program-data/Anchor.toml b/tests/bpf-upgradable-state/Anchor.toml similarity index 76% rename from tests/program-data/Anchor.toml rename to tests/bpf-upgradable-state/Anchor.toml index ab3c043e4a..e2dd5a31aa 100644 --- a/tests/program-data/Anchor.toml +++ b/tests/bpf-upgradable-state/Anchor.toml @@ -1,5 +1,5 @@ [programs.localnet] -program_data = "Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e" +bpf_upgradable_state = "Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e" [registry] url = "https://anchor.projectserum.com" diff --git a/tests/program-data/Cargo.toml b/tests/bpf-upgradable-state/Cargo.toml similarity index 100% rename from tests/program-data/Cargo.toml rename to tests/bpf-upgradable-state/Cargo.toml diff --git a/tests/program-data/program_data-keypair.json b/tests/bpf-upgradable-state/bpf_upgradable_state-keypair.json similarity index 100% rename from tests/program-data/program_data-keypair.json rename to tests/bpf-upgradable-state/bpf_upgradable_state-keypair.json diff --git a/tests/program-data/migrations/deploy.ts b/tests/bpf-upgradable-state/migrations/deploy.ts similarity index 100% rename from tests/program-data/migrations/deploy.ts rename to tests/bpf-upgradable-state/migrations/deploy.ts diff --git a/tests/program-data/package.json b/tests/bpf-upgradable-state/package.json similarity index 100% rename from tests/program-data/package.json rename to tests/bpf-upgradable-state/package.json diff --git a/tests/program-data/programs/program-data/Cargo.toml b/tests/bpf-upgradable-state/programs/bpf-upgradable-state/Cargo.toml similarity index 81% rename from tests/program-data/programs/program-data/Cargo.toml rename to tests/bpf-upgradable-state/programs/bpf-upgradable-state/Cargo.toml index 06c28d432b..c4a10315c9 100644 --- a/tests/program-data/programs/program-data/Cargo.toml +++ b/tests/bpf-upgradable-state/programs/bpf-upgradable-state/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "program-data" +name = "bpf-upgradable-state" version = "0.1.0" description = "Created with Anchor" edition = "2018" [lib] crate-type = ["cdylib", "lib"] -name = "program_data" +name = "bpf_upgradable_state" [features] no-entrypoint = [] diff --git a/tests/program-data/programs/program-data/Xargo.toml b/tests/bpf-upgradable-state/programs/bpf-upgradable-state/Xargo.toml similarity index 100% rename from tests/program-data/programs/program-data/Xargo.toml rename to tests/bpf-upgradable-state/programs/bpf-upgradable-state/Xargo.toml diff --git a/tests/program-data/programs/program-data/src/lib.rs b/tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs similarity index 96% rename from tests/program-data/programs/program-data/src/lib.rs rename to tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs index 573a1358cf..b563aabc41 100644 --- a/tests/program-data/programs/program-data/src/lib.rs +++ b/tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs @@ -6,7 +6,7 @@ declare_id!("Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e"); // Add constraint that program.program_data_address == program_data.key() #[program] -pub mod program_data { +pub mod bpf_upgradable_state { use super::*; pub fn set_admin_settings(ctx: Context, admin_data: u64) -> ProgramResult { ctx.accounts.settings.admin_data = admin_data; diff --git a/tests/program-data/tests/program-data.ts b/tests/bpf-upgradable-state/tests/bpf-upgradable-state.ts similarity index 94% rename from tests/program-data/tests/program-data.ts rename to tests/bpf-upgradable-state/tests/bpf-upgradable-state.ts index b62c0fb8a5..4c999a0ce3 100644 --- a/tests/program-data/tests/program-data.ts +++ b/tests/bpf-upgradable-state/tests/bpf-upgradable-state.ts @@ -1,16 +1,15 @@ import * as anchor from '@project-serum/anchor'; import { Program } from '@project-serum/anchor'; import { findProgramAddressSync } from '@project-serum/anchor/dist/cjs/utils/pubkey'; -import { sleep } from '@project-serum/common'; import assert from 'assert'; -import { ProgramData } from '../target/types/program_data'; +import { BpfUpgradableState } from '../target/types/bpf_upgradable_state'; -describe('program-data', () => { +describe('bpf_upgradable_state', () => { const provider = anchor.Provider.env(); // Configure the client to use the local cluster. anchor.setProvider(provider); - const program = anchor.workspace.ProgramData as Program; + const program = anchor.workspace.BpfUpgradableState as Program; const programDataAddress = findProgramAddressSync( [program.programId.toBytes()], new anchor.web3.PublicKey("BPFLoaderUpgradeab1e11111111111111111111111") diff --git a/tests/program-data/tsconfig.json b/tests/bpf-upgradable-state/tsconfig.json similarity index 100% rename from tests/program-data/tsconfig.json rename to tests/bpf-upgradable-state/tsconfig.json From 95fbba55e2137496dcd8bb6bd62d0c7104e3c2b4 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sun, 5 Dec 2021 02:42:02 +0100 Subject: [PATCH 20/21] fixed type in bpf_upgradeable_state and added more tests --- .github/workflows/tests.yaml | 66 ++++++++++--------- CHANGELOG.md | 2 +- ...able_state.rs => bpf_upgradeable_state.rs} | 0 lang/src/error.rs | 2 - lang/src/lib.rs | 4 +- .../programs/bpf-upgradable-state/src/lib.rs | 32 --------- .../.gitignore | 0 .../Anchor.toml | 2 +- .../Cargo.toml | 0 .../bpf_upgradeable_state-keypair.json} | 0 .../migrations/deploy.ts | 0 .../package.json | 0 .../program_with_different_programdata.json | 1 + .../bpf-upgradeable-state}/Cargo.toml | 4 +- .../bpf-upgradeable-state}/Xargo.toml | 0 .../programs/bpf-upgradeable-state/src/lib.rs | 53 +++++++++++++++ .../tests/bpf-upgradable-state.ts | 64 +++++++++++------- .../tsconfig.json | 0 ts/src/error.ts | 5 -- 19 files changed, 136 insertions(+), 99 deletions(-) rename lang/src/{bpf_upgradable_state.rs => bpf_upgradeable_state.rs} (100%) delete mode 100644 tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/.gitignore (100%) rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/Anchor.toml (75%) rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/Cargo.toml (100%) rename tests/{bpf-upgradable-state/bpf_upgradable_state-keypair.json => bpf-upgradeable-state/bpf_upgradeable_state-keypair.json} (100%) rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/migrations/deploy.ts (100%) rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/package.json (100%) create mode 100644 tests/bpf-upgradeable-state/program_with_different_programdata.json rename tests/{bpf-upgradable-state/programs/bpf-upgradable-state => bpf-upgradeable-state/programs/bpf-upgradeable-state}/Cargo.toml (80%) rename tests/{bpf-upgradable-state/programs/bpf-upgradable-state => bpf-upgradeable-state/programs/bpf-upgradeable-state}/Xargo.toml (100%) create mode 100644 tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/src/lib.rs rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/tests/bpf-upgradable-state.ts (61%) rename tests/{bpf-upgradable-state => bpf-upgradeable-state}/tsconfig.json (100%) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 371235baad..5060d25ed0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -179,45 +179,47 @@ jobs: - uses: ./.github/actions/setup-solana/ - run: cd client/example && ./run-test.sh - test-bpf-upgradable-state: + test-bpf-upgradeable-state: needs: setup-anchor-cli - name: Test tests/bpf-upgradable-state + name: Test tests/bpf-upgradeable-state runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/setup/ - - uses: ./.github/actions/setup-ts/ - - uses: ./.github/actions/setup-solana/ + - uses: actions/checkout@v2 + - uses: ./.github/actions/setup/ + - uses: ./.github/actions/setup-ts/ + - uses: ./.github/actions/setup-solana/ - - uses: actions/cache@v2 - name: Cache Cargo registry + index - id: cache-anchor - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - ./target/ - key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }} + - uses: actions/cache@v2 + name: Cache Cargo registry + index + id: cache-anchor + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ./target/ + key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }} - - uses: actions/download-artifact@v2 - with: - name: anchor-binary - path: ~/.cargo/bin/ + - uses: actions/download-artifact@v2 + with: + name: anchor-binary + path: ~/.cargo/bin/ - - uses: actions/cache@v2 - name: Cache tests/bpf-upgradable-state target - id: cache-test-target - with: - path: tests/bpf-upgradable-state/target - key: cargo-${{ runner.os }}-tests/bpf-upgradable-state-${{ env.ANCHOR_VERSION }} + - uses: actions/cache@v2 + name: Cache tests/bpf-upgradeable-state target + id: cache-test-target + with: + path: tests/bpf-upgradeable-state/target + key: cargo-${{ runner.os }}-tests/bpf-upgradeable-state-${{ env.ANCHOR_VERSION }} - - run: solana-test-validator -r --quiet & - name: start validator - - run: cd tests/bpf-upgradable-state && yarn - - run: cd tests/bpf-upgradable-state && yarn link @project-serum/anchor - - run: cd tests/bpf-upgradable-state && anchor build && cp bpf_upgradable_state-keypair.json target/deploy/bpf_upgradable_state-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build + - run: solana-test-validator -r --quiet & + name: start validator + - run: cd tests/bpf-upgradeable-state && yarn + - run: cd tests/bpf-upgradeable-state && yarn link @project-serum/anchor + - run: cd tests/bpf-upgradeable-state && anchor build + - run: cd tests/bpf-upgradeable-state && solana program deploy --program-id program_with_different_programdata.json target/deploy/bpf_upgradeable_state.so + - run: cd tests/bpf-upgradeable-state && cp bpf_upgradeable_state-keypair.json target/deploy/bpf_upgradeable_state-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build test-programs: needs: setup-anchor-cli diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c3adc6d1..57897f9962 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ incremented for features. * lang: Add `ErrorCode::AccountNotInitialized` error to separate the situation when the account has the wrong owner from when it does not exist (#[1024](https://github.com/project-serum/anchor/pull/1024)) * lang: Called instructions now log their name by default. This can be turned off with the `no-log-ix-name` flag ([#1057](https://github.com/project-serum/anchor/pull/1057)) -* lang: Add `ProgramData` AccountInfo wrapper that checks that given AccountInfo is owned by the upgradable loader and that its deserialization is the `ProgramData` variant of [UpgradeableLoaderState](https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html) ([#1095](https://github.com/project-serum/anchor/pull/1095)) +* lang: Add `ProgramData` AccountInfo wrapper that checks that given AccountInfo is owned by the upgradeable loader and that its deserialization is the `ProgramData` variant of [UpgradeableLoaderState](https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html) ([#1095](https://github.com/project-serum/anchor/pull/1095)) * ts: Add better error msgs in the ts client if something wrong (i.e. not a pubkey or a string) is passed in as an account in an instruction accounts object ([#1098](https://github.com/project-serum/anchor/pull/1098)) ## [0.18.2] - 2021-11-14 diff --git a/lang/src/bpf_upgradable_state.rs b/lang/src/bpf_upgradeable_state.rs similarity index 100% rename from lang/src/bpf_upgradable_state.rs rename to lang/src/bpf_upgradeable_state.rs diff --git a/lang/src/error.rs b/lang/src/error.rs index c49641a45f..70a7ca977e 100644 --- a/lang/src/error.rs +++ b/lang/src/error.rs @@ -78,8 +78,6 @@ pub enum ErrorCode { AccountNotInitialized, #[msg("The given account is not a program data account")] AccountNotProgramData, - #[msg("The given account is not a program")] - AccountNotProgram, // State. #[msg("The given state account does not have the correct address")] diff --git a/lang/src/lib.rs b/lang/src/lib.rs index 807aa63423..b570c22b70 100644 --- a/lang/src/lib.rs +++ b/lang/src/lib.rs @@ -35,7 +35,7 @@ mod account; mod account_info; mod account_meta; mod boxed; -mod bpf_upgradable_state; +mod bpf_upgradeable_state; mod common; mod context; mod cpi_account; @@ -57,7 +57,7 @@ mod unchecked_account; mod vec; pub use crate::account::Account; -pub use crate::bpf_upgradable_state::*; +pub use crate::bpf_upgradeable_state::*; #[doc(hidden)] #[allow(deprecated)] pub use crate::context::CpiStateContext; diff --git a/tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs b/tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs deleted file mode 100644 index b563aabc41..0000000000 --- a/tests/bpf-upgradable-state/programs/bpf-upgradable-state/src/lib.rs +++ /dev/null @@ -1,32 +0,0 @@ -use anchor_lang::prelude::*; - -declare_id!("Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e"); - -// TODO: Once anchor can deserialize program data, update this test. -// Add constraint that program.program_data_address == program_data.key() - -#[program] -pub mod bpf_upgradable_state { - use super::*; - pub fn set_admin_settings(ctx: Context, admin_data: u64) -> ProgramResult { - ctx.accounts.settings.admin_data = admin_data; - Ok(()) - } -} - -#[account] -#[derive(Default, Debug)] -pub struct Settings { - admin_data: u64 -} - -#[derive(Accounts)] -pub struct SetAdminSettings<'info> { - #[account(init, payer = authority)] - pub settings: Account<'info, Settings>, - #[account(mut)] - pub authority: Signer<'info>, - #[account(constraint = program_data.upgrade_authority_address == Some(authority.key()))] - pub program_data: Account<'info, ProgramData>, - pub system_program: Program<'info, System> -} diff --git a/tests/bpf-upgradable-state/.gitignore b/tests/bpf-upgradeable-state/.gitignore similarity index 100% rename from tests/bpf-upgradable-state/.gitignore rename to tests/bpf-upgradeable-state/.gitignore diff --git a/tests/bpf-upgradable-state/Anchor.toml b/tests/bpf-upgradeable-state/Anchor.toml similarity index 75% rename from tests/bpf-upgradable-state/Anchor.toml rename to tests/bpf-upgradeable-state/Anchor.toml index e2dd5a31aa..84740b9ee9 100644 --- a/tests/bpf-upgradable-state/Anchor.toml +++ b/tests/bpf-upgradeable-state/Anchor.toml @@ -1,5 +1,5 @@ [programs.localnet] -bpf_upgradable_state = "Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e" +bpf_upgradeable_state = "Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e" [registry] url = "https://anchor.projectserum.com" diff --git a/tests/bpf-upgradable-state/Cargo.toml b/tests/bpf-upgradeable-state/Cargo.toml similarity index 100% rename from tests/bpf-upgradable-state/Cargo.toml rename to tests/bpf-upgradeable-state/Cargo.toml diff --git a/tests/bpf-upgradable-state/bpf_upgradable_state-keypair.json b/tests/bpf-upgradeable-state/bpf_upgradeable_state-keypair.json similarity index 100% rename from tests/bpf-upgradable-state/bpf_upgradable_state-keypair.json rename to tests/bpf-upgradeable-state/bpf_upgradeable_state-keypair.json diff --git a/tests/bpf-upgradable-state/migrations/deploy.ts b/tests/bpf-upgradeable-state/migrations/deploy.ts similarity index 100% rename from tests/bpf-upgradable-state/migrations/deploy.ts rename to tests/bpf-upgradeable-state/migrations/deploy.ts diff --git a/tests/bpf-upgradable-state/package.json b/tests/bpf-upgradeable-state/package.json similarity index 100% rename from tests/bpf-upgradable-state/package.json rename to tests/bpf-upgradeable-state/package.json diff --git a/tests/bpf-upgradeable-state/program_with_different_programdata.json b/tests/bpf-upgradeable-state/program_with_different_programdata.json new file mode 100644 index 0000000000..8825b0f8e9 --- /dev/null +++ b/tests/bpf-upgradeable-state/program_with_different_programdata.json @@ -0,0 +1 @@ +[86,234,116,86,82,140,116,250,254,32,75,217,35,39,9,238,39,98,242,254,25,216,201,66,1,239,93,12,81,19,34,108,219,67,158,98,245,234,81,126,228,157,205,206,130,5,14,54,1,21,88,246,128,124,240,93,157,49,102,19,253,19,205,178] \ No newline at end of file diff --git a/tests/bpf-upgradable-state/programs/bpf-upgradable-state/Cargo.toml b/tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/Cargo.toml similarity index 80% rename from tests/bpf-upgradable-state/programs/bpf-upgradable-state/Cargo.toml rename to tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/Cargo.toml index c4a10315c9..ac3164c1fa 100644 --- a/tests/bpf-upgradable-state/programs/bpf-upgradable-state/Cargo.toml +++ b/tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "bpf-upgradable-state" +name = "bpf-upgradeable-state" version = "0.1.0" description = "Created with Anchor" edition = "2018" [lib] crate-type = ["cdylib", "lib"] -name = "bpf_upgradable_state" +name = "bpf_upgradeable_state" [features] no-entrypoint = [] diff --git a/tests/bpf-upgradable-state/programs/bpf-upgradable-state/Xargo.toml b/tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/Xargo.toml similarity index 100% rename from tests/bpf-upgradable-state/programs/bpf-upgradable-state/Xargo.toml rename to tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/Xargo.toml diff --git a/tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/src/lib.rs b/tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/src/lib.rs new file mode 100644 index 0000000000..d7405cef6a --- /dev/null +++ b/tests/bpf-upgradeable-state/programs/bpf-upgradeable-state/src/lib.rs @@ -0,0 +1,53 @@ +use anchor_lang::prelude::*; + +declare_id!("Cum9tTyj5HwcEiAmhgaS7Bbj4UczCwsucrCkxRECzM4e"); + +// TODO: Once anchor can deserialize data of programs (=programdata_address) automatically, add another test to this file. +// Instead of using UpgradeableLoaderState, it should use Program<'info, MY_PROGRAM> + +#[program] +pub mod bpf_upgradeable_state { + use super::*; + pub fn set_admin_settings(ctx: Context, admin_data: u64) -> ProgramResult { + match *ctx.accounts.program { + UpgradeableLoaderState::Program { + programdata_address, + } => { + if programdata_address != ctx.accounts.program_data.key() { + return Err(CustomError::InvalidProgramDataAddress.into()); + } + } + _ => { + return Err(CustomError::AccountNotProgram.into()); + } + }; + ctx.accounts.settings.admin_data = admin_data; + Ok(()) + } +} + +#[account] +#[derive(Default, Debug)] +pub struct Settings { + admin_data: u64, +} + +#[error] +pub enum CustomError { + InvalidProgramDataAddress, + AccountNotProgram, +} + +#[derive(Accounts)] +#[instruction(admin_data: u64)] +pub struct SetAdminSettings<'info> { + #[account(init, payer = authority)] + pub settings: Account<'info, Settings>, + #[account(mut)] + pub authority: Signer<'info>, + #[account(address = crate::ID)] + pub program: Account<'info, UpgradeableLoaderState>, + #[account(constraint = program_data.upgrade_authority_address == Some(authority.key()))] + pub program_data: Account<'info, ProgramData>, + pub system_program: Program<'info, System>, +} diff --git a/tests/bpf-upgradable-state/tests/bpf-upgradable-state.ts b/tests/bpf-upgradeable-state/tests/bpf-upgradable-state.ts similarity index 61% rename from tests/bpf-upgradable-state/tests/bpf-upgradable-state.ts rename to tests/bpf-upgradeable-state/tests/bpf-upgradable-state.ts index 4c999a0ce3..eef41fe03f 100644 --- a/tests/bpf-upgradable-state/tests/bpf-upgradable-state.ts +++ b/tests/bpf-upgradeable-state/tests/bpf-upgradable-state.ts @@ -1,15 +1,16 @@ import * as anchor from '@project-serum/anchor'; import { Program } from '@project-serum/anchor'; import { findProgramAddressSync } from '@project-serum/anchor/dist/cjs/utils/pubkey'; +import { PublicKey } from '@solana/web3.js'; import assert from 'assert'; -import { BpfUpgradableState } from '../target/types/bpf_upgradable_state'; +import { BpfUpgradeableState } from '../target/types/bpf_upgradeable_state'; -describe('bpf_upgradable_state', () => { +describe('bpf_upgradeable_state', () => { const provider = anchor.Provider.env(); // Configure the client to use the local cluster. anchor.setProvider(provider); - const program = anchor.workspace.BpfUpgradableState as Program; + const program = anchor.workspace.BpfUpgradeableState as Program; const programDataAddress = findProgramAddressSync( [program.programId.toBytes()], new anchor.web3.PublicKey("BPFLoaderUpgradeab1e11111111111111111111111") @@ -22,6 +23,7 @@ describe('bpf_upgradable_state', () => { authority: program.provider.wallet.publicKey, systemProgram: anchor.web3.SystemProgram.programId, programData: programDataAddress, + program: program.programId, settings: settings.publicKey }, signers: [settings] @@ -44,7 +46,8 @@ describe('bpf_upgradable_state', () => { authority: authority.publicKey, systemProgram: anchor.web3.SystemProgram.programId, programData: programDataAddress, - settings: settings.publicKey + settings: settings.publicKey, + program: program.programId, }, signers: [settings, authority] }); @@ -58,19 +61,15 @@ describe('bpf_upgradable_state', () => { it('Validates that account is ProgramData', async () => { const settings = anchor.web3.Keypair.generate(); try { - const authority = anchor.web3.Keypair.generate(); - await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(authority.publicKey, 10000000000), - "confirmed" - ); await program.rpc.setAdminSettings(new anchor.BN(500), { accounts: { - authority: authority.publicKey, + authority: program.provider.wallet.publicKey, systemProgram: anchor.web3.SystemProgram.programId, programData: program.programId, - settings: settings.publicKey + settings: settings.publicKey, + program: program.programId, }, - signers: [settings, authority] + signers: [settings] }); assert.ok(false); } catch (err) { @@ -79,22 +78,18 @@ describe('bpf_upgradable_state', () => { } }); - it('Validates that account is owned by the upgradable bpf loader', async () => { + it('Validates that account is owned by the upgradeable bpf loader', async () => { const settings = anchor.web3.Keypair.generate(); try { - const authority = anchor.web3.Keypair.generate(); - await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(authority.publicKey, 10000000000), - "confirmed" - ); await program.rpc.setAdminSettings(new anchor.BN(500), { accounts: { - authority: authority.publicKey, + authority: program.provider.wallet.publicKey, systemProgram: anchor.web3.SystemProgram.programId, - programData: authority.publicKey, - settings: settings.publicKey + programData: program.provider.wallet.publicKey, + settings: settings.publicKey, + program: program.programId, }, - signers: [settings, authority] + signers: [settings] }); assert.ok(false); } catch (err) { @@ -102,4 +97,29 @@ describe('bpf_upgradable_state', () => { assert.equal(err.msg, "The given account is not owned by the executing program"); } }); + + it('Deserializes UpgradableLoaderState and validates that programData is the expected account', async () => { + const secondProgramAddress = new PublicKey("Fkv67TwmbakfZw2PoW57wYPbqNexAH6vuxpyT8vmrc3B"); + const secondProgramProgramDataAddress = findProgramAddressSync( + [secondProgramAddress.toBytes()], + new anchor.web3.PublicKey("BPFLoaderUpgradeab1e11111111111111111111111") + )[0]; + + const settings = anchor.web3.Keypair.generate(); + try { + await program.rpc.setAdminSettings(new anchor.BN(500), { + accounts: { + authority: program.provider.wallet.publicKey, + systemProgram: anchor.web3.SystemProgram.programId, + programData: secondProgramProgramDataAddress, + settings: settings.publicKey, + program: program.programId, + }, + signers: [settings] + }); + assert.ok(false); + } catch (err) { + assert.equal(err.code, 300); + } + }); }); diff --git a/tests/bpf-upgradable-state/tsconfig.json b/tests/bpf-upgradeable-state/tsconfig.json similarity index 100% rename from tests/bpf-upgradable-state/tsconfig.json rename to tests/bpf-upgradeable-state/tsconfig.json diff --git a/ts/src/error.ts b/ts/src/error.ts index e1b16084e5..d31fa5adca 100644 --- a/ts/src/error.ts +++ b/ts/src/error.ts @@ -91,7 +91,6 @@ const LangErrorCode = { AccountNotSystemOwned: 171, AccountNotInitialized: 172, AccountNotProgramData: 173, - AccountNotUpgradableBPFOwned: 174, // State. StateInvalidAddress: 180, @@ -186,10 +185,6 @@ const LangErrorMessage = new Map([ LangErrorCode.AccountNotProgramData, "The given account is not a program data account", ], - [ - LangErrorCode.AccountNotUpgradableBPFOwned, - "The given account is not owned by the upgradable BPF loader", - ], // State. [ From aa40e8c9b90074a59393c977f4f355b8672dc224 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sun, 5 Dec 2021 02:55:55 +0100 Subject: [PATCH 21/21] docs: update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57897f9962..8427a2f693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ incremented for features. * lang: Add `ErrorCode::AccountNotInitialized` error to separate the situation when the account has the wrong owner from when it does not exist (#[1024](https://github.com/project-serum/anchor/pull/1024)) * lang: Called instructions now log their name by default. This can be turned off with the `no-log-ix-name` flag ([#1057](https://github.com/project-serum/anchor/pull/1057)) -* lang: Add `ProgramData` AccountInfo wrapper that checks that given AccountInfo is owned by the upgradeable loader and that its deserialization is the `ProgramData` variant of [UpgradeableLoaderState](https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html) ([#1095](https://github.com/project-serum/anchor/pull/1095)) +* lang: `ProgramData` and `UpgradableLoaderState` can now be passed into `Account` as generics. see [UpgradeableLoaderState](https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html). `UpgradableLoaderState` can also be matched on to get `ProgramData`, but when `ProgramData` is used instead, anchor does the serialization and checking that it is actually program data for you ([#1095](https://github.com/project-serum/anchor/pull/1095)) * ts: Add better error msgs in the ts client if something wrong (i.e. not a pubkey or a string) is passed in as an account in an instruction accounts object ([#1098](https://github.com/project-serum/anchor/pull/1098)) ## [0.18.2] - 2021-11-14