From f69034243f27afb3152457a25431fc196da052ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 13:03:41 +0900 Subject: [PATCH 01/47] fix: Eager evaluation with overflow-checks might abort exec --- contracts/programs/store/src/state.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/programs/store/src/state.rs b/contracts/programs/store/src/state.rs index d004c664a..c20430d58 100644 --- a/contracts/programs/store/src/state.rs +++ b/contracts/programs/store/src/state.rs @@ -151,11 +151,13 @@ impl<'a> Feed<'a> { let offset = latest_round_id - round_id; let offset = offset + 1; // + 1 because we're looking for the element before the cursor + // with overflow-checks = true the else branch could abort + #[allow(clippy::unnecessary_lazy_evaluations)] let index = self .header .live_cursor .checked_sub(offset) - .unwrap_or(self.live.len() as u32 - (offset - self.header.live_cursor)); + .unwrap_or_else(|| self.live.len() as u32 - (offset - self.header.live_cursor)); Some(self.live[index as usize]) } else if (historical_start..=historical_end).contains(&round_id) { @@ -164,11 +166,13 @@ impl<'a> Feed<'a> { let offset = (historical_end - round_id) / granularity; let offset = offset + 1; // + 1 because we're looking for the element before the cursor + // with overflow-checks = true the else branch could abort + #[allow(clippy::unnecessary_lazy_evaluations)] let index = self .header .historical_cursor .checked_sub(offset) - .unwrap_or({ + .unwrap_or_else(|| { self.historical.len() as u32 - (offset - self.header.historical_cursor) }); From 2cdc6b3af51940083af93ee1e7b59bcfa50b8c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 13:22:29 +0900 Subject: [PATCH 02/47] fix: Verify payees are token accounts --- contracts/programs/ocr2/src/lib.rs | 14 ++++++-------- contracts/tests/ocr2.spec.ts | 3 ++- .../src/commands/contracts/ocr2/proposePayees.ts | 3 ++- tests/e2e/solclient/ocr2.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 34e85073d..932eb4ead 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -278,25 +278,23 @@ pub mod ocr2 { } #[access_control(proposal_owner(&ctx.accounts.proposal, &ctx.accounts.authority))] - pub fn propose_payees( - ctx: Context, - token_mint: Pubkey, - payees: Vec, - ) -> Result<()> { + pub fn propose_payees(ctx: Context, token_mint: Pubkey) -> Result<()> { let mut proposal = ctx.accounts.proposal.load_mut()?; require!(proposal.state != Proposal::FINALIZED, InvalidInput); + let payees = ctx.remaining_accounts; + // Need to provide a payee for each oracle require!(proposal.oracles.len() == payees.len(), PayeeOracleMismatch); // Verify that the remaining accounts are valid token accounts. - for account in ctx.remaining_accounts { + for account in payees { let account = Account::<'_, token::TokenAccount>::try_from(account)?; require!(account.mint == token_mint, InvalidTokenAccount); } - for (oracle, payee) in proposal.oracles.iter_mut().zip(payees.into_iter()) { - oracle.payee = payee; + for (oracle, payee) in proposal.oracles.iter_mut().zip(payees.iter()) { + oracle.payee = payee.key(); } proposal.token_mint = token_mint; diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 62dbd9616..c33d47573 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -533,14 +533,15 @@ describe("ocr2", async () => { }); console.log("proposePayees"); + let payees = oracles.map((oracle) => oracle.payee.address); await program.rpc.proposePayees( token.publicKey, - oracles.map((oracle) => oracle.payee.address), { accounts: { proposal: proposal.publicKey, authority: owner.publicKey, }, + remainingAccounts: payees, } ); diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index a1c0333b4..61ba38989 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -121,11 +121,12 @@ export default class ProposePayees extends SolanaCommand { .slice(0, proposalInfo.oracles.len) .map(({ transmitter }) => this.contractInput.payeeByTransmitter[transmitter.toString()]) - const ix = this.program.instruction.proposePayees(token.publicKey, payees, { + const ix = this.program.instruction.proposePayees(token.publicKey, { accounts: { proposal, authority: signer, }, + remainingAccounts: payees, }) return [ix] } diff --git a/tests/e2e/solclient/ocr2.go b/tests/e2e/solclient/ocr2.go index 97022cfba..eee82adbe 100644 --- a/tests/e2e/solclient/ocr2.go +++ b/tests/e2e/solclient/ocr2.go @@ -353,10 +353,10 @@ func (m *OCRv2) proposeConfig(ocConfig contracts.OffChainAggregatorV2Config) err } instr = append(instr, ocr_2.NewProposePayeesInstruction( m.Mint.PublicKey(), - payees, m.Proposal.PublicKey(), m.Owner.PublicKey()).Build(), ) + // TODO: how to set payees as remaining return m.Client.TXSync( "Set payees", rpc.CommitmentFinalized, From 1d2158615569461a7804abb4d12300e75a638ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 13:24:06 +0900 Subject: [PATCH 03/47] Update to anchor 0.25.0, solana-program 1.10 --- contracts/Anchor.toml | 2 +- contracts/Cargo.lock | 809 ++++++++++++------ contracts/crates/chainlink-solana/Cargo.toml | 2 +- contracts/examples/hello-world/Cargo.lock | 764 +++++++++++------ contracts/examples/hello-world/package.json | 2 +- .../programs/hello-world/Cargo.toml | 4 +- contracts/examples/hello-world/yarn.lock | 27 +- contracts/package.json | 2 +- .../programs/access-controller/Cargo.toml | 2 +- contracts/programs/ocr2/Cargo.toml | 4 +- contracts/programs/ocr2/src/lib.rs | 10 +- contracts/programs/store/Cargo.toml | 2 +- contracts/yarn.lock | 35 +- .../gauntlet-serum-multisig/package.json | 2 +- .../packages/gauntlet-solana/package.json | 2 +- gauntlet/yarn.lock | 27 +- 16 files changed, 1101 insertions(+), 595 deletions(-) diff --git a/contracts/Anchor.toml b/contracts/Anchor.toml index d448daf48..aa229ed2b 100644 --- a/contracts/Anchor.toml +++ b/contracts/Anchor.toml @@ -1,4 +1,4 @@ -anchor_version = "0.23.0" +anchor_version = "0.25.0" [registry] url = "https://anchor.projectserum.com" diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index 5dc7d6109..40e5e099d 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -17,7 +17,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.7", "once_cell", "version_check", ] @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb917e636aa85cbb0d908e948cf7646c78a3e2fb06f396522d01fa55ec93412f" +checksum = "70f6ee9518f50ff4d434471ccf569186022bdd5ef65a21d14da3ea5231af944f" dependencies = [ "anchor-syn", "anyhow", @@ -47,9 +47,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40132c6a9ecf26f6a1d0480824d4e7327bade791d6afe2e003546f58b450e760" +checksum = "32c92bcf5388b52676d990f85bbfd838a8f5672393135063a50dc79b2b837c79" dependencies = [ "anchor-syn", "anyhow", @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b229e8eb84adf4c282b45bf03354a265f629cb657323728570d994ca0f8ef0" +checksum = "0844974ac35e8ced62056b0d63777ebcdc5807438b8b189c881e2b647450b70a" dependencies = [ "anchor-syn", "proc-macro2", @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc0aaf2dae975810ee9f09135cb91b4df66d3834c9bbb789f0930fde2b2a49c" +checksum = "0f7467345e67a6f1d4b862b9763a4160ad89d18c247b8c902807768f7b6e23df" dependencies = [ "anchor-syn", "proc-macro2", @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aefe4f159ae2ccaa908ad7625639294be02602543c5ea8e7b6c8c6126640a8e" +checksum = "8774e4c1ac71f71a5aea7e4932fb69c30e3b8155c4fa59fd69401195434528a9" dependencies = [ "anchor-syn", "anyhow", @@ -98,9 +98,9 @@ dependencies = [ [[package]] name = "anchor-attribute-interface" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7885efaa71230455a55f2078c130c8168ba58a01271d769a9e3e7753041b023b" +checksum = "90eeb6e1c80f9f94fcef93a52813f6472186200e275e83cb3fac92b801de92f7" dependencies = [ "anchor-syn", "anyhow", @@ -112,9 +112,9 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962fa82552a2d36ac0a72410a7a63dce16ff84d5921f3195cf1427c89d3848d" +checksum = "ac515a7a5a4fea7fc768b1cec40ddb948e148ea657637c75f94f283212326cb9" dependencies = [ "anchor-syn", "anyhow", @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "anchor-attribute-state" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbb91124f1e49d5d84b4c812f47442830ddf8e5b25e7e7fbbe8027ea9a55f4e" +checksum = "43dc667b62ff71450f19dcfcc37b0c408fd4ddd89e8650368c2b0984b110603f" dependencies = [ "anchor-syn", "anyhow", @@ -138,9 +138,9 @@ dependencies = [ [[package]] name = "anchor-derive-accounts" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acbc8ab9e4305ae5fdfecc0e40f1254db28747d0bb4a4adf0d63dd09366bac6" +checksum = "7354d583a06701d24800a8ec4c2b0491f62581a331af349205e23421e0b56643" dependencies = [ "anchor-syn", "anyhow", @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720b81290f0323ab655380fe80d6aeb678c77500e07e5d75e7693b611895b5a4" +checksum = "ff5f57ec5e12fa6874b27f3d5c1f6f44302d3ad86c1266197ff7611bf6f5d251" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -175,9 +175,9 @@ dependencies = [ [[package]] name = "anchor-spl" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302c7285127b097d90e188eb9a7488ea9099550cceb86f27177d51d67df609b5" +checksum = "d65904c3106851f6d1bb87d504044764819d69c51d2b4346d59d399d8afa7d18" dependencies = [ "anchor-lang", "solana-program", @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18fdb2a5bba16db5d2121935284d3fe226cf35ef1c549162abcb2c50c5b7e21" +checksum = "55aa1e680d9471342122ed5b6bc13bf5da473b0f7e4677d41a6954e5cc8ad155" dependencies = [ "anyhow", "bs58 0.3.1", @@ -199,16 +199,16 @@ dependencies = [ "quote", "serde", "serde_json", - "sha2", + "sha2 0.9.9", "syn", "thiserror", ] [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" [[package]] name = "arrayref" @@ -218,30 +218,19 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "arrayvec" version = "1.0.0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -264,19 +253,33 @@ dependencies = [ "serde", ] +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + [[package]] name = "blake3" -version = "0.3.8" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", - "arrayvec 0.5.2", + "arrayvec 0.7.2", "cc", - "cfg-if 0.1.10", + "cfg-if", "constant_time_eq", - "crypto-mac", - "digest 0.9.0", + "digest 0.10.3", ] [[package]] @@ -285,21 +288,23 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding", - "generic-array 0.14.5", + "generic-array", ] [[package]] -name = "block-padding" -version = "0.2.1" +name = "block-buffer" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] [[package]] name = "borsh" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9d0958efb8301e1626692ea879cbff622ef45cf731807ec8d488b34be98cb8" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" dependencies = [ "borsh-derive", "hashbrown", @@ -307,9 +312,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325164710ad57bae6d32455ce3bd384f95768464a927ce145626dc3390a7f9fe" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", @@ -320,9 +325,9 @@ dependencies = [ [[package]] name = "borsh-derive-internal" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f74159f43b231f4af8c4ce4967fef76e4e59725acf51706ddb9268c94348d15c" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2", "quote", @@ -331,9 +336,9 @@ dependencies = [ [[package]] name = "borsh-schema-derive-internal" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b2a77771907a820a860d200d193a0787c79a7890c8e253c462fa0f51ad58b6" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2", "quote", @@ -352,6 +357,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + [[package]] name = "bv" version = "0.11.1" @@ -364,18 +375,18 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.7.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +checksum = "a5377c8865e74a160d21f29c2d40669f53286db6eab59b88540cbb12ffc8b835" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +checksum = "cfd2f4180c5721da6335cc9e9061cce522b87a35e51cc57636d28d22a9863c80" dependencies = [ "proc-macro2", "quote", @@ -390,15 +401,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" - -[[package]] -name = "cfg-if" -version = "0.1.10" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -415,6 +420,26 @@ dependencies = [ "solana-program", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +dependencies = [ + "log", + "web-sys", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -423,78 +448,122 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "once_cell", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.5", + "generic-array", "subtle", ] [[package]] name = "curve25519-dalek" -version = "2.1.3" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" dependencies = [ "byteorder", - "digest 0.8.1", - "rand_core", + "digest 0.9.0", + "rand_core 0.5.1", "subtle", "zeroize", ] [[package]] name = "digest" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.12.4", + "generic-array", ] [[package]] name = "digest" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "generic-array 0.14.5", + "block-buffer 0.10.2", + "crypto-common", + "subtle", ] [[package]] name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "env_logger" -version = "0.8.4" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" [[package]] name = "feature-probe" @@ -502,15 +571,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.5" @@ -528,20 +588,22 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", + "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -571,12 +633,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "hmac" version = "0.8.1" @@ -594,36 +650,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.5", + "generic-array", "hmac", ] [[package]] -name = "humantime" -version = "2.1.0" +name = "im" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.3", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "js-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +dependencies = [ + "wasm-bindgen", +] [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "lazy_static" @@ -633,15 +708,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.116" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libsecp256k1" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1137239ab33b41aa9637a88a28249e5e70c40a42ccc92db7f12cc356c1fcd7" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" dependencies = [ "arrayref", "base64 0.12.3", @@ -652,7 +727,7 @@ dependencies = [ "libsecp256k1-gen-genmult", "rand", "serde", - "sha2", + "sha2 0.9.9", "typenum", ] @@ -685,30 +760,49 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.1.0" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "3a79b39c93a7a5a27eeaf9a23b5ff43f1b9e0ad6b1cdd441140ae53c35613fc7" dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "num-derive" version = "0.3.3" @@ -722,29 +816,39 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + [[package]] name = "num_enum" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -766,9 +870,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "opaque-debug" @@ -776,6 +880,29 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -793,9 +920,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", "toml", @@ -803,11 +930,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -825,9 +952,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.15" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -841,7 +968,7 @@ dependencies = [ "getrandom 0.1.16", "libc", "rand_chacha", - "rand_core", + "rand_core 0.5.1", "rand_hc", ] @@ -852,7 +979,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", ] [[package]] @@ -864,20 +991,68 @@ dependencies = [ "getrandom 0.1.16", ] +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" + [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -886,69 +1061,66 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "rustc_version" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] -name = "semver" -version = "0.9.0" +name = "scopeguard" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "semver-parser" -version = "0.7.0" +name = "semver" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" dependencies = [ "proc-macro2", "quote", @@ -957,9 +1129,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa", "ryu", @@ -972,50 +1144,77 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", + "block-buffer 0.9.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + [[package]] name = "sha3" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" dependencies = [ - "block-buffer", - "digest 0.9.0", + "digest 0.10.3", "keccak", - "opaque-debug", ] +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + [[package]] name = "solana-frozen-abi" -version = "1.8.14" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3495c76034ef52472ff4c5cd82f513073b415a7ac962d9a8aefe906a216e6392" +checksum = "49a5d3280421bb53fc12bdba1eaa505153fb4f99a06b5609dae22192652ead3b" dependencies = [ - "bs58 0.3.1", + "bs58 0.4.0", "bv", - "generic-array 0.14.5", + "generic-array", + "im", + "lazy_static", "log", "memmap2", "rustc_version", "serde", + "serde_bytes", "serde_derive", - "sha2", + "sha2 0.10.2", "solana-frozen-abi-macro", - "solana-logger", "thiserror", ] [[package]] name = "solana-frozen-abi-macro" -version = "1.8.14" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2193bd0e23b5bc93fce0533248c43b8aa53b27a91298e49d6fd018f51c43138" +checksum = "635c60ac96b1347af272c625465068b908aff919d19f29b5795a44310310494d" dependencies = [ "proc-macro2", "quote", @@ -1023,61 +1222,55 @@ dependencies = [ "syn", ] -[[package]] -name = "solana-logger" -version = "1.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4adacba4cc6b9d39899718fff3e312b32496ae44e570dfeff23d8b7ac60ad79" -dependencies = [ - "env_logger", - "lazy_static", - "log", -] - [[package]] name = "solana-program" -version = "1.8.14" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f706757ff4b34f0f1fac72204bb2bfbda3c1a939c6c72ae25f1b31635d08bb" +checksum = "eeecf504cee2821b006871f70e7a1f54db15f914cedf259eaf5976fe606470f0" dependencies = [ "base64 0.13.0", "bincode", + "bitflags", "blake3", "borsh", "borsh-derive", - "bs58 0.3.1", + "bs58 0.4.0", "bv", "bytemuck", + "console_error_panic_hook", + "console_log", "curve25519-dalek", - "hex", + "getrandom 0.1.16", "itertools", + "js-sys", "lazy_static", "libsecp256k1", "log", "num-derive", "num-traits", + "parking_lot", "rand", "rustc_version", "rustversion", "serde", "serde_bytes", "serde_derive", - "sha2", + "sha2 0.10.2", "sha3", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-logger", "solana-sdk-macro", "thiserror", + "wasm-bindgen", ] [[package]] name = "solana-sdk-macro" -version = "1.8.14" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc226c8458927a632f152e44c80b5eb69e1ea74af444a026a617dd5d691bd9" +checksum = "2b8bcac4394644f21dc013e932a7df9f536fcecef3e5df43fe362b4ec532ce30" dependencies = [ - "bs58 0.3.1", + "bs58 0.4.0", "proc-macro2", "quote", "rustversion", @@ -1086,19 +1279,20 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428" +checksum = "2b013067447a1396303ddfc294f36e3d260a32f8a16c501c295bcdc7de39b490" dependencies = [ + "borsh", "solana-program", "spl-token", ] [[package]] name = "spl-token" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bfdd5bd7c869cb565c7d7635c4fafe189b988a0bdef81063cd9585c6b8dc01" +checksum = "0cc67166ef99d10c18cb5e9c208901e6d8255c6513bb1f877977eba48e6cc4fb" dependencies = [ "arrayref", "num-derive", @@ -1131,38 +1325,29 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", - "unicode-xid", -] - -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", + "unicode-ident", ] [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", @@ -1171,9 +1356,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] @@ -1185,16 +1370,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] -name = "unicode-segmentation" -version = "1.8.0" +name = "unicode-ident" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "unicode-segmentation" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "version_check" @@ -1210,49 +1395,125 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "winapi" -version = "0.3.9" +name = "wasm-bindgen" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "cfg-if", + "wasm-bindgen-macro", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "wasm-bindgen-backend" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] [[package]] -name = "winapi-util" -version = "0.1.5" +name = "wasm-bindgen-macro" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "winapi", + "quote", + "wasm-bindgen-macro-support", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "wasm-bindgen-macro-support" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" + +[[package]] +name = "web-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "yansi" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zeroize" -version = "1.5.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4062c749be08d90be727e9c5895371c3a0e49b90ba2b9592dc7afda95cc2b719" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/contracts/crates/chainlink-solana/Cargo.toml b/contracts/crates/chainlink-solana/Cargo.toml index 02e25c9f2..9a43d07b0 100644 --- a/contracts/crates/chainlink-solana/Cargo.toml +++ b/contracts/crates/chainlink-solana/Cargo.toml @@ -15,6 +15,6 @@ name = "chainlink_solana" default = [] [dependencies] -solana-program = "1.8.6" +solana-program = "1.10.25" borsh = "0.9.1" borsh-derive = "0.9.1" \ No newline at end of file diff --git a/contracts/examples/hello-world/Cargo.lock b/contracts/examples/hello-world/Cargo.lock index 7778d7c50..1ac81b799 100644 --- a/contracts/examples/hello-world/Cargo.lock +++ b/contracts/examples/hello-world/Cargo.lock @@ -8,7 +8,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.7", "once_cell", "version_check", ] @@ -24,9 +24,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.23.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb917e636aa85cbb0d908e948cf7646c78a3e2fb06f396522d01fa55ec93412f" +checksum = "70f6ee9518f50ff4d434471ccf569186022bdd5ef65a21d14da3ea5231af944f" dependencies = [ "anchor-syn", "anyhow", @@ -38,9 +38,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40132c6a9ecf26f6a1d0480824d4e7327bade791d6afe2e003546f58b450e760" +checksum = "32c92bcf5388b52676d990f85bbfd838a8f5672393135063a50dc79b2b837c79" dependencies = [ "anchor-syn", "anyhow", @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b229e8eb84adf4c282b45bf03354a265f629cb657323728570d994ca0f8ef0" +checksum = "0844974ac35e8ced62056b0d63777ebcdc5807438b8b189c881e2b647450b70a" dependencies = [ "anchor-syn", "proc-macro2", @@ -64,9 +64,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc0aaf2dae975810ee9f09135cb91b4df66d3834c9bbb789f0930fde2b2a49c" +checksum = "0f7467345e67a6f1d4b862b9763a4160ad89d18c247b8c902807768f7b6e23df" dependencies = [ "anchor-syn", "proc-macro2", @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aefe4f159ae2ccaa908ad7625639294be02602543c5ea8e7b6c8c6126640a8e" +checksum = "8774e4c1ac71f71a5aea7e4932fb69c30e3b8155c4fa59fd69401195434528a9" dependencies = [ "anchor-syn", "anyhow", @@ -89,9 +89,9 @@ dependencies = [ [[package]] name = "anchor-attribute-interface" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7885efaa71230455a55f2078c130c8168ba58a01271d769a9e3e7753041b023b" +checksum = "90eeb6e1c80f9f94fcef93a52813f6472186200e275e83cb3fac92b801de92f7" dependencies = [ "anchor-syn", "anyhow", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962fa82552a2d36ac0a72410a7a63dce16ff84d5921f3195cf1427c89d3848d" +checksum = "ac515a7a5a4fea7fc768b1cec40ddb948e148ea657637c75f94f283212326cb9" dependencies = [ "anchor-syn", "anyhow", @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "anchor-attribute-state" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbb91124f1e49d5d84b4c812f47442830ddf8e5b25e7e7fbbe8027ea9a55f4e" +checksum = "43dc667b62ff71450f19dcfcc37b0c408fd4ddd89e8650368c2b0984b110603f" dependencies = [ "anchor-syn", "anyhow", @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "anchor-derive-accounts" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acbc8ab9e4305ae5fdfecc0e40f1254db28747d0bb4a4adf0d63dd09366bac6" +checksum = "7354d583a06701d24800a8ec4c2b0491f62581a331af349205e23421e0b56643" dependencies = [ "anchor-syn", "anyhow", @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720b81290f0323ab655380fe80d6aeb678c77500e07e5d75e7693b611895b5a4" +checksum = "ff5f57ec5e12fa6874b27f3d5c1f6f44302d3ad86c1266197ff7611bf6f5d251" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -166,9 +166,9 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18fdb2a5bba16db5d2121935284d3fe226cf35ef1c549162abcb2c50c5b7e21" +checksum = "55aa1e680d9471342122ed5b6bc13bf5da473b0f7e4677d41a6954e5cc8ad155" dependencies = [ "anyhow", "bs58 0.3.1", @@ -178,16 +178,16 @@ dependencies = [ "quote", "serde", "serde_json", - "sha2", + "sha2 0.9.9", "syn", "thiserror", ] [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" [[package]] name = "arrayref" @@ -197,20 +197,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "autocfg" @@ -239,19 +228,33 @@ dependencies = [ "serde", ] +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + [[package]] name = "blake3" -version = "0.3.8" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if 0.1.10", + "cfg-if", "constant_time_eq", - "crypto-mac", - "digest 0.9.0", + "digest 0.10.3", ] [[package]] @@ -260,15 +263,17 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding", - "generic-array 0.14.5", + "generic-array", ] [[package]] -name = "block-padding" -version = "0.2.1" +name = "block-buffer" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] [[package]] name = "borsh" @@ -327,6 +332,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + [[package]] name = "bv" version = "0.11.1" @@ -339,18 +350,18 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.7.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +checksum = "a5377c8865e74a160d21f29c2d40669f53286db6eab59b88540cbb12ffc8b835" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +checksum = "cfd2f4180c5721da6335cc9e9061cce522b87a35e51cc57636d28d22a9863c80" dependencies = [ "proc-macro2", "quote", @@ -365,15 +376,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -383,15 +388,35 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chainlink_solana" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e5a3c8b6ff2c7b5c668e2e64a5640db6dec6654d7b9e18671e18a8af1d4bd5" +checksum = "44e1a6c94acdef947c091751143a1271c433fe140ed045888c0a1248330b1647" dependencies = [ "borsh", "borsh-derive", "solana-program", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +dependencies = [ + "log", + "web-sys", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -400,78 +425,122 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "once_cell", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.5", + "generic-array", "subtle", ] [[package]] name = "curve25519-dalek" -version = "2.1.3" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" dependencies = [ "byteorder", - "digest 0.8.1", - "rand_core", + "digest 0.9.0", + "rand_core 0.5.1", "subtle", "zeroize", ] [[package]] name = "digest" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.12.4", + "generic-array", ] [[package]] name = "digest" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "generic-array 0.14.5", + "block-buffer 0.10.2", + "crypto-common", + "subtle", ] [[package]] name = "either" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "env_logger" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" [[package]] name = "feature-probe" @@ -479,15 +548,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.5" @@ -505,20 +565,22 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", + "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -556,12 +618,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "hmac" version = "0.8.1" @@ -579,36 +635,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.5", + "generic-array", "hmac", ] [[package]] -name = "humantime" -version = "2.1.0" +name = "im" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.3", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "js-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +dependencies = [ + "wasm-bindgen", +] [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "lazy_static" @@ -618,15 +693,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.117" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libsecp256k1" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1137239ab33b41aa9637a88a28249e5e70c40a42ccc92db7f12cc356c1fcd7" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" dependencies = [ "arrayref", "base64 0.12.3", @@ -637,7 +712,7 @@ dependencies = [ "libsecp256k1-gen-genmult", "rand", "serde", - "sha2", + "sha2 0.9.9", "typenum", ] @@ -670,30 +745,49 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.1.0" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "3a79b39c93a7a5a27eeaf9a23b5ff43f1b9e0ad6b1cdd441140ae53c35613fc7" dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "num-derive" version = "0.3.3" @@ -707,18 +801,28 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + [[package]] name = "once_cell" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "opaque-debug" @@ -726,6 +830,29 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -743,11 +870,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -765,9 +892,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.15" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -781,7 +908,7 @@ dependencies = [ "getrandom 0.1.16", "libc", "rand_chacha", - "rand_core", + "rand_core 0.5.1", "rand_hc", ] @@ -792,7 +919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", ] [[package]] @@ -804,20 +931,68 @@ dependencies = [ "getrandom 0.1.16", ] +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" + [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -826,69 +1001,66 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "rustc_version" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] -name = "semver" -version = "0.9.0" +name = "scopeguard" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "semver-parser" -version = "0.7.0" +name = "semver" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" dependencies = [ "proc-macro2", "quote", @@ -897,9 +1069,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa", "ryu", @@ -912,50 +1084,77 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", + "block-buffer 0.9.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + [[package]] name = "sha3" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" dependencies = [ - "block-buffer", - "digest 0.9.0", + "digest 0.10.3", "keccak", - "opaque-debug", ] +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + [[package]] name = "solana-frozen-abi" -version = "1.8.16" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "425be155319bda665dc3483f0c0267ac0fc89017812d0c5d9816b1c7a26c1532" +checksum = "49a5d3280421bb53fc12bdba1eaa505153fb4f99a06b5609dae22192652ead3b" dependencies = [ - "bs58 0.3.1", + "bs58 0.4.0", "bv", - "generic-array 0.14.5", + "generic-array", + "im", + "lazy_static", "log", "memmap2", "rustc_version", "serde", + "serde_bytes", "serde_derive", - "sha2", + "sha2 0.10.2", "solana-frozen-abi-macro", - "solana-logger", "thiserror", ] [[package]] name = "solana-frozen-abi-macro" -version = "1.8.16" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d97737c34380c42c9b3e060cf68d1929ad81fea5a3c00887bb82314b788ba13" +checksum = "635c60ac96b1347af272c625465068b908aff919d19f29b5795a44310310494d" dependencies = [ "proc-macro2", "quote", @@ -963,61 +1162,55 @@ dependencies = [ "syn", ] -[[package]] -name = "solana-logger" -version = "1.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659d836ac49f5a53481ead26f4ea78b688a91dedcbe6c51454169491e1648ceb" -dependencies = [ - "env_logger", - "lazy_static", - "log", -] - [[package]] name = "solana-program" -version = "1.8.16" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b2b6d99b5c662975ead69a60ead75b820f2eaa42eb4512c79a919e91807d43" +checksum = "eeecf504cee2821b006871f70e7a1f54db15f914cedf259eaf5976fe606470f0" dependencies = [ "base64 0.13.0", "bincode", + "bitflags", "blake3", "borsh", "borsh-derive", - "bs58 0.3.1", + "bs58 0.4.0", "bv", "bytemuck", + "console_error_panic_hook", + "console_log", "curve25519-dalek", - "hex", + "getrandom 0.1.16", "itertools", + "js-sys", "lazy_static", "libsecp256k1", "log", "num-derive", "num-traits", + "parking_lot", "rand", "rustc_version", "rustversion", "serde", "serde_bytes", "serde_derive", - "sha2", + "sha2 0.10.2", "sha3", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-logger", "solana-sdk-macro", "thiserror", + "wasm-bindgen", ] [[package]] name = "solana-sdk-macro" -version = "1.8.16" +version = "1.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a122a01e936f3b69064f0800e0488617833fc6a4dd86294cf7cc75f34511d6b5" +checksum = "2b8bcac4394644f21dc013e932a7df9f536fcecef3e5df43fe362b4ec532ce30" dependencies = [ - "bs58 0.3.1", + "bs58 0.4.0", "proc-macro2", "quote", "rustversion", @@ -1032,38 +1225,29 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", - "unicode-xid", -] - -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", + "unicode-ident", ] [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", @@ -1072,9 +1256,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] @@ -1086,16 +1270,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] -name = "unicode-segmentation" -version = "1.9.0" +name = "unicode-ident" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "unicode-segmentation" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "version_check" @@ -1111,49 +1295,125 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "winapi" -version = "0.3.9" +name = "wasm-bindgen" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "cfg-if", + "wasm-bindgen-macro", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "wasm-bindgen-backend" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] [[package]] -name = "winapi-util" -version = "0.1.5" +name = "wasm-bindgen-macro" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "winapi", + "quote", + "wasm-bindgen-macro-support", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "wasm-bindgen-macro-support" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" + +[[package]] +name = "web-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "yansi" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zeroize" -version = "1.5.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/contracts/examples/hello-world/package.json b/contracts/examples/hello-world/package.json index 20d5189ba..caf95efe0 100644 --- a/contracts/examples/hello-world/package.json +++ b/contracts/examples/hello-world/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@project-serum/anchor": "^0.23.0" + "@project-serum/anchor": "^0.25.0" }, "devDependencies": { "chai": "^4.3.4", diff --git a/contracts/examples/hello-world/programs/hello-world/Cargo.toml b/contracts/examples/hello-world/programs/hello-world/Cargo.toml index e1bc615bd..1f2919775 100644 --- a/contracts/examples/hello-world/programs/hello-world/Cargo.toml +++ b/contracts/examples/hello-world/programs/hello-world/Cargo.toml @@ -16,5 +16,5 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "0.23.0" -chainlink_solana = "0.1.2" +anchor-lang = "0.25.0" +chainlink_solana = "0.1.1" diff --git a/contracts/examples/hello-world/yarn.lock b/contracts/examples/hello-world/yarn.lock index a916f89f4..0808010d6 100644 --- a/contracts/examples/hello-world/yarn.lock +++ b/contracts/examples/hello-world/yarn.lock @@ -30,10 +30,10 @@ "@ethersproject/logger" "^5.5.0" hash.js "1.1.7" -"@project-serum/anchor@^0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.23.0.tgz#2b2eb6b51601b073e8db26663aa2d6c2f2841771" - integrity sha512-LV2/ifZOJVFTZ4GbEloXln3iVfCvO1YM8i7BBCrUm4tehP7irMx4nr4/IabHWOzrQcQElsxSP/lb1tBp+2ff8A== +"@project-serum/anchor@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.25.0.tgz#88ee4843336005cf5a64c80636ce626f0996f503" + integrity sha512-E6A5Y/ijqpfMJ5psJvbw0kVTzLZFUcOFgs6eSM2M2iWE1lVRF18T6hWZVNl6zqZsoz98jgnNHtVGJMs+ds9A7A== dependencies: "@project-serum/borsh" "^0.2.5" "@solana/web3.js" "^1.36.0" @@ -45,10 +45,10 @@ cross-fetch "^3.1.5" 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" + superstruct "^0.15.4" toml "^3.0.0" "@project-serum/borsh@^0.2.5": @@ -523,13 +523,6 @@ find-up@5.0.0: 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" @@ -1026,6 +1019,11 @@ superstruct@^0.14.2: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== +superstruct@^0.15.4: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + supports-color@8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -1067,11 +1065,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= -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" diff --git a/contracts/package.json b/contracts/package.json index f5e2f369f..24b908a6e 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@chainlink/solana-sdk": "../ts", - "@project-serum/anchor": "^0.23.0", + "@project-serum/anchor": "^0.25.0", "@solana/spl-token": "^0.1.8", "@solana/web3.js": "1.31.0", "@types/chai": "^4.2.22", diff --git a/contracts/programs/access-controller/Cargo.toml b/contracts/programs/access-controller/Cargo.toml index cc880fb31..3d6b9e219 100644 --- a/contracts/programs/access-controller/Cargo.toml +++ b/contracts/programs/access-controller/Cargo.toml @@ -15,6 +15,6 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "0.23.0" +anchor-lang = "0.25.0" static_assertions = "1.1.0" arrayvec = { version = "1.0.0", path = "../../crates/arrayvec" } diff --git a/contracts/programs/ocr2/Cargo.toml b/contracts/programs/ocr2/Cargo.toml index 08bd8bccc..8daed40d3 100644 --- a/contracts/programs/ocr2/Cargo.toml +++ b/contracts/programs/ocr2/Cargo.toml @@ -15,8 +15,8 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = { version = "0.23.0", features = [] } -anchor-spl = "0.23.0" +anchor-lang = { version = "0.25.0", features = [] } +anchor-spl = "0.25.0" static_assertions = "1.1.0" access-controller = { version = "1.0.0", path = "../access-controller", default-features = false, features = ["cpi"] } store = { version = "1.0.0", path = "../store", default-features = false, features = ["cpi"] } diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 932eb4ead..e12e99588 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -332,10 +332,16 @@ pub mod ocr2 { // Use a raw instruction to skip data decoding, but keep using Anchor contexts. let mut bumps = std::collections::BTreeMap::new(); + let mut reallocs = std::collections::BTreeSet::new(); // Deserialize accounts. let mut remaining_accounts: &[AccountInfo] = accounts; - let mut accounts = - Transmit::try_accounts(program_id, &mut remaining_accounts, data, &mut bumps)?; + let mut accounts = Transmit::try_accounts( + program_id, + &mut remaining_accounts, + data, + &mut bumps, + &mut reallocs, + )?; // Construct a context let ctx = Context::new(program_id, &mut accounts, remaining_accounts, bumps); diff --git a/contracts/programs/store/Cargo.toml b/contracts/programs/store/Cargo.toml index 56ca89ba2..5a2d61b85 100644 --- a/contracts/programs/store/Cargo.toml +++ b/contracts/programs/store/Cargo.toml @@ -15,6 +15,6 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "0.23.0" +anchor-lang = "0.25.0" access-controller = { version = "1.0.0", path = "../access-controller", default-features = false, features = ["cpi"] } bytemuck = "1.7.2" diff --git a/contracts/yarn.lock b/contracts/yarn.lock index ee904b69b..2071ce67e 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -43,10 +43,10 @@ "@ethersproject/logger" "^5.6.0" hash.js "1.1.7" -"@project-serum/anchor@^0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.23.0.tgz#2b2eb6b51601b073e8db26663aa2d6c2f2841771" - integrity sha512-LV2/ifZOJVFTZ4GbEloXln3iVfCvO1YM8i7BBCrUm4tehP7irMx4nr4/IabHWOzrQcQElsxSP/lb1tBp+2ff8A== +"@project-serum/anchor@^0.24.2": + version "0.24.2" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.24.2.tgz#a3c52a99605c80735f446ca9b3a4885034731004" + integrity sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA== dependencies: "@project-serum/borsh" "^0.2.5" "@solana/web3.js" "^1.36.0" @@ -58,16 +58,15 @@ cross-fetch "^3.1.5" 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/anchor@^0.24.2": - version "0.24.2" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.24.2.tgz#a3c52a99605c80735f446ca9b3a4885034731004" - integrity sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA== +"@project-serum/anchor@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.25.0.tgz#88ee4843336005cf5a64c80636ce626f0996f503" + integrity sha512-E6A5Y/ijqpfMJ5psJvbw0kVTzLZFUcOFgs6eSM2M2iWE1lVRF18T6hWZVNl6zqZsoz98jgnNHtVGJMs+ds9A7A== dependencies: "@project-serum/borsh" "^0.2.5" "@solana/web3.js" "^1.36.0" @@ -82,6 +81,7 @@ js-sha256 "^0.9.0" pako "^2.0.3" snake-case "^3.0.4" + superstruct "^0.15.4" toml "^3.0.0" "@project-serum/borsh@^0.2.5": @@ -763,13 +763,6 @@ find-up@5.0.0: 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" @@ -1359,6 +1352,11 @@ superstruct@^0.14.2: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== +superstruct@^0.15.4: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + supports-color@8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -1400,11 +1398,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -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" diff --git a/gauntlet/packages/gauntlet-serum-multisig/package.json b/gauntlet/packages/gauntlet-serum-multisig/package.json index 09922cbd3..65cb754f4 100644 --- a/gauntlet/packages/gauntlet-serum-multisig/package.json +++ b/gauntlet/packages/gauntlet-serum-multisig/package.json @@ -27,7 +27,7 @@ "dependencies": { "@chainlink/gauntlet-core": "0.1.2", "@chainlink/gauntlet-solana": "*", - "@project-serum/anchor": "^0.23.0", + "@project-serum/anchor": "^0.25.0", "@solana/web3.js": "^1.31.0" } } diff --git a/gauntlet/packages/gauntlet-solana/package.json b/gauntlet/packages/gauntlet-solana/package.json index dc8e495c2..7e5bf97fd 100644 --- a/gauntlet/packages/gauntlet-solana/package.json +++ b/gauntlet/packages/gauntlet-solana/package.json @@ -28,7 +28,7 @@ "@chainlink/gauntlet-core": "0.1.2", "@ledgerhq/hw-app-solana": "^6.20.0", "@ledgerhq/hw-transport-node-hid": "^6.20.0", - "@project-serum/anchor": "^0.23.0", + "@project-serum/anchor": "^0.25.0", "@project-serum/borsh": "^0.2.2", "@solana/web3.js": "^1.31.0" } diff --git a/gauntlet/yarn.lock b/gauntlet/yarn.lock index 12aa82569..22f81f5f0 100644 --- a/gauntlet/yarn.lock +++ b/gauntlet/yarn.lock @@ -848,10 +848,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@project-serum/anchor@^0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.23.0.tgz#2b2eb6b51601b073e8db26663aa2d6c2f2841771" - integrity sha512-LV2/ifZOJVFTZ4GbEloXln3iVfCvO1YM8i7BBCrUm4tehP7irMx4nr4/IabHWOzrQcQElsxSP/lb1tBp+2ff8A== +"@project-serum/anchor@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.25.0.tgz#88ee4843336005cf5a64c80636ce626f0996f503" + integrity sha512-E6A5Y/ijqpfMJ5psJvbw0kVTzLZFUcOFgs6eSM2M2iWE1lVRF18T6hWZVNl6zqZsoz98jgnNHtVGJMs+ds9A7A== dependencies: "@project-serum/borsh" "^0.2.5" "@solana/web3.js" "^1.36.0" @@ -863,10 +863,10 @@ cross-fetch "^3.1.5" 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" + superstruct "^0.15.4" toml "^3.0.0" "@project-serum/borsh@^0.2.2": @@ -2481,13 +2481,6 @@ find-yarn-workspace-root2@1.2.16: micromatch "^4.0.2" pkg-dir "^4.2.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" - follow-redirects@^1.14.4: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" @@ -5091,6 +5084,11 @@ superstruct@^0.14.2: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== +superstruct@^0.15.4: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -5258,11 +5256,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= -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= - trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" From e19d7a49cecfec07002282d4ea4904ed10435408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 13:42:49 +0900 Subject: [PATCH 04/47] Provider -> AnchorProvider --- .../gauntlet-solana/src/commands/internal/solana.ts | 6 +++--- .../packages/gauntlet-solana/src/commands/middlewares.ts | 4 ++-- gauntlet/packages/gauntlet-solana/src/lib/provider.ts | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana/src/commands/internal/solana.ts b/gauntlet/packages/gauntlet-solana/src/commands/internal/solana.ts index 5db2bd403..2837fcaf1 100644 --- a/gauntlet/packages/gauntlet-solana/src/commands/internal/solana.ts +++ b/gauntlet/packages/gauntlet-solana/src/commands/internal/solana.ts @@ -12,14 +12,14 @@ import { } from '@solana/web3.js' import { withProvider, withWallet, withNetwork } from '../middlewares' import { TransactionResponse } from '../types' -import { ProgramError, parseIdlErrors, Idl, Program, Provider } from '@project-serum/anchor' +import { ProgramError, parseIdlErrors, Idl, Program, AnchorProvider } from '@project-serum/anchor' import { SolanaWallet } from '../wallet' import { logger } from '@chainlink/gauntlet-core/dist/utils' import { makeTx } from '../../lib/utils' export default abstract class SolanaCommand extends WriteCommand { wallet: SolanaWallet - provider: Provider + provider: AnchorProvider program: Program abstract execute: () => Promise> @@ -139,7 +139,7 @@ export default abstract class SolanaCommand extends WriteCommand => { try { - return await this.provider.send(tx, signers) + return await this.provider.sendAndConfirm(tx, signers) } catch (err) { // Translate IDL error const idlErrors = parseIdlErrors(idl) diff --git a/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts b/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts index fa80f3af3..a5612b0dd 100644 --- a/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts +++ b/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts @@ -1,7 +1,7 @@ import { Middleware, Next } from '@chainlink/gauntlet-core' import { boolean } from '@chainlink/gauntlet-core/dist/lib/args' import { assertions, logger } from '@chainlink/gauntlet-core/dist/utils' -import { Provider } from '@project-serum/anchor' +import { AnchorProvider } from '@project-serum/anchor' import { Connection, Keypair } from '@solana/web3.js' import { DEFAULT_DERIVATION_PATH } from '../lib/constants' import SolanaCommand from './internal/solana' @@ -18,7 +18,7 @@ export const withProvider: Middleware = (c: SolanaCommand, next: Next) => { `Invalid NODE_URL (${nodeURL}), please add an http:// or https:// prefix`, ) - c.provider = new Provider(new Connection(nodeURL), c.wallet, {}) + c.provider = new AnchorProvider(new Connection(nodeURL), c.wallet, {}) return next() } diff --git a/gauntlet/packages/gauntlet-solana/src/lib/provider.ts b/gauntlet/packages/gauntlet-solana/src/lib/provider.ts index 1a759a490..02d4a3a67 100644 --- a/gauntlet/packages/gauntlet-solana/src/lib/provider.ts +++ b/gauntlet/packages/gauntlet-solana/src/lib/provider.ts @@ -28,7 +28,9 @@ const parseTxLog = (parser: EventParser, tx: ParsedTransactionWithMeta | null): const addToList = (event: Event) => eventList.push(event) if (tx?.meta?.logMessages) { - parser.parseLogs(tx.meta.logMessages, addToList) + for (const event of parser.parseLogs(tx.meta.logMessages)) { + addToList(event) + } } return eventList From 72fc684b85a3f126b0f7a08d56368a932ec4ac1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 14:06:30 +0900 Subject: [PATCH 05/47] Regenerate bindings --- .../access_controller/AcceptOwnership.go | 10 ++-- .../generated/access_controller/AddAccess.go | 14 ++--- .../generated/access_controller/Initialize.go | 10 ++-- .../access_controller/RemoveAccess.go | 14 ++--- .../access_controller/TransferOwnership.go | 10 ++-- contracts/generated/ocr2/AcceptOwnership.go | 12 ++-- .../generated/ocr2/AcceptOwnership_test.go | 2 +- contracts/generated/ocr2/AcceptPayeeship.go | 20 +++---- .../generated/ocr2/AcceptPayeeship_test.go | 2 +- contracts/generated/ocr2/AcceptProposal.go | 32 +++++----- .../generated/ocr2/AcceptProposal_test.go | 2 +- contracts/generated/ocr2/Close.go | 28 ++++----- contracts/generated/ocr2/CloseProposal.go | 16 ++--- .../generated/ocr2/CloseProposal_test.go | 2 +- contracts/generated/ocr2/Close_test.go | 2 +- contracts/generated/ocr2/CreateProposal.go | 12 ++-- .../generated/ocr2/CreateProposal_test.go | 2 +- contracts/generated/ocr2/FinalizeProposal.go | 12 ++-- .../generated/ocr2/FinalizeProposal_test.go | 2 +- contracts/generated/ocr2/Initialize.go | 56 ++++++++--------- contracts/generated/ocr2/Initialize_test.go | 2 +- contracts/generated/ocr2/PayOracles.go | 28 ++++----- contracts/generated/ocr2/PayOracles_test.go | 2 +- contracts/generated/ocr2/ProposeConfig.go | 12 ++-- .../generated/ocr2/ProposeConfig_test.go | 2 +- contracts/generated/ocr2/ProposePayees.go | 37 +++--------- .../generated/ocr2/ProposePayees_test.go | 2 +- contracts/generated/ocr2/RequestNewRound.go | 16 ++--- .../generated/ocr2/RequestNewRound_test.go | 2 +- contracts/generated/ocr2/SetBilling.go | 28 ++++----- .../ocr2/SetBillingAccessController.go | 16 ++--- .../ocr2/SetBillingAccessController_test.go | 2 +- contracts/generated/ocr2/SetBilling_test.go | 2 +- .../ocr2/SetRequesterAccessController.go | 16 ++--- .../ocr2/SetRequesterAccessController_test.go | 2 +- contracts/generated/ocr2/TransferOwnership.go | 12 ++-- .../generated/ocr2/TransferOwnership_test.go | 2 +- contracts/generated/ocr2/TransferPayeeship.go | 24 ++++---- .../generated/ocr2/TransferPayeeship_test.go | 2 +- contracts/generated/ocr2/WithdrawFunds.go | 32 +++++----- .../generated/ocr2/WithdrawFunds_test.go | 2 +- contracts/generated/ocr2/WithdrawPayment.go | 28 ++++----- .../generated/ocr2/WithdrawPayment_test.go | 2 +- .../generated/ocr2/WriteOffchainConfig.go | 12 ++-- .../ocr2/WriteOffchainConfig_test.go | 2 +- contracts/generated/ocr2/accounts.go | 2 +- contracts/generated/ocr2/instructions.go | 2 +- contracts/generated/ocr2/testing_utils.go | 2 +- contracts/generated/ocr2/types.go | 2 +- .../generated/store/AcceptFeedOwnership.go | 14 ++--- .../generated/store/AcceptStoreOwnership.go | 10 ++-- contracts/generated/store/CloseFeed.go | 18 +++--- contracts/generated/store/CreateFeed.go | 10 ++-- contracts/generated/store/Initialize.go | 14 ++--- contracts/generated/store/LowerFlag.go | 18 +++--- contracts/generated/store/Query.go | 28 ++++----- .../store/SetLoweringAccessController.go | 14 ++--- .../generated/store/SetValidatorConfig.go | 14 ++--- contracts/generated/store/SetWriter.go | 14 ++--- contracts/generated/store/Submit.go | 10 ++-- .../generated/store/TransferFeedOwnership.go | 14 ++--- .../generated/store/TransferStoreOwnership.go | 10 ++-- contracts/generated/store/types.go | 60 +++++++++---------- 63 files changed, 390 insertions(+), 413 deletions(-) diff --git a/contracts/generated/access_controller/AcceptOwnership.go b/contracts/generated/access_controller/AcceptOwnership.go index 6c5177cde..23541f084 100644 --- a/contracts/generated/access_controller/AcceptOwnership.go +++ b/contracts/generated/access_controller/AcceptOwnership.go @@ -16,7 +16,7 @@ type AcceptOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. @@ -35,7 +35,7 @@ func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *Accep // GetStateAccount gets the "state" account. func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst AcceptOwnership) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/access_controller/AddAccess.go b/contracts/generated/access_controller/AddAccess.go index 3c7488630..c4506b7ec 100644 --- a/contracts/generated/access_controller/AddAccess.go +++ b/contracts/generated/access_controller/AddAccess.go @@ -18,7 +18,7 @@ type AddAccess struct { // [1] = [SIGNER] owner // // [2] = [] address - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAddAccessInstructionBuilder creates a new `AddAccess` instruction builder. @@ -37,7 +37,7 @@ func (inst *AddAccess) SetStateAccount(state ag_solanago.PublicKey) *AddAccess { // GetStateAccount gets the "state" account. func (inst *AddAccess) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -48,7 +48,7 @@ func (inst *AddAccess) SetOwnerAccount(owner ag_solanago.PublicKey) *AddAccess { // GetOwnerAccount gets the "owner" account. func (inst *AddAccess) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAddressAccount sets the "address" account. @@ -59,7 +59,7 @@ func (inst *AddAccess) SetAddressAccount(address ag_solanago.PublicKey) *AddAcce // GetAddressAccount gets the "address" account. func (inst *AddAccess) GetAddressAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst AddAccess) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *AddAccess) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/access_controller/Initialize.go b/contracts/generated/access_controller/Initialize.go index ce22ef71b..78fbaa644 100644 --- a/contracts/generated/access_controller/Initialize.go +++ b/contracts/generated/access_controller/Initialize.go @@ -16,7 +16,7 @@ type Initialize struct { // [0] = [WRITE] state // // [1] = [SIGNER] owner - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. @@ -35,7 +35,7 @@ func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize // GetStateAccount gets the "state" account. func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -46,7 +46,7 @@ func (inst *Initialize) SetOwnerAccount(owner ag_solanago.PublicKey) *Initialize // GetOwnerAccount gets the "owner" account. func (inst *Initialize) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst Initialize) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta("state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("owner", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/access_controller/RemoveAccess.go b/contracts/generated/access_controller/RemoveAccess.go index 567a66b5a..31bafb811 100644 --- a/contracts/generated/access_controller/RemoveAccess.go +++ b/contracts/generated/access_controller/RemoveAccess.go @@ -18,7 +18,7 @@ type RemoveAccess struct { // [1] = [SIGNER] owner // // [2] = [] address - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewRemoveAccessInstructionBuilder creates a new `RemoveAccess` instruction builder. @@ -37,7 +37,7 @@ func (inst *RemoveAccess) SetStateAccount(state ag_solanago.PublicKey) *RemoveAc // GetStateAccount gets the "state" account. func (inst *RemoveAccess) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -48,7 +48,7 @@ func (inst *RemoveAccess) SetOwnerAccount(owner ag_solanago.PublicKey) *RemoveAc // GetOwnerAccount gets the "owner" account. func (inst *RemoveAccess) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAddressAccount sets the "address" account. @@ -59,7 +59,7 @@ func (inst *RemoveAccess) SetAddressAccount(address ag_solanago.PublicKey) *Remo // GetAddressAccount gets the "address" account. func (inst *RemoveAccess) GetAddressAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst RemoveAccess) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *RemoveAccess) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/access_controller/TransferOwnership.go b/contracts/generated/access_controller/TransferOwnership.go index c6b8f3f50..e057d2030 100644 --- a/contracts/generated/access_controller/TransferOwnership.go +++ b/contracts/generated/access_controller/TransferOwnership.go @@ -17,7 +17,7 @@ type TransferOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. @@ -42,7 +42,7 @@ func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *Tra // GetStateAccount gets the "state" account. func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicK // GetAuthorityAccount gets the "authority" account. func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst TransferOwnership) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/AcceptOwnership.go b/contracts/generated/ocr2/AcceptOwnership.go index 666a8211b..aec920ac5 100644 --- a/contracts/generated/ocr2/AcceptOwnership.go +++ b/contracts/generated/ocr2/AcceptOwnership.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -16,7 +16,7 @@ type AcceptOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. @@ -35,7 +35,7 @@ func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *Accep // GetStateAccount gets the "state" account. func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst AcceptOwnership) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/AcceptOwnership_test.go b/contracts/generated/ocr2/AcceptOwnership_test.go index 4771fa165..d3776ba67 100644 --- a/contracts/generated/ocr2/AcceptOwnership_test.go +++ b/contracts/generated/ocr2/AcceptOwnership_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/AcceptPayeeship.go b/contracts/generated/ocr2/AcceptPayeeship.go index 95ae73dc3..80913b2c3 100644 --- a/contracts/generated/ocr2/AcceptPayeeship.go +++ b/contracts/generated/ocr2/AcceptPayeeship.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -20,7 +20,7 @@ type AcceptPayeeship struct { // [2] = [] transmitter // // [3] = [] proposedPayee - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAcceptPayeeshipInstructionBuilder creates a new `AcceptPayeeship` instruction builder. @@ -39,7 +39,7 @@ func (inst *AcceptPayeeship) SetStateAccount(state ag_solanago.PublicKey) *Accep // GetStateAccount gets the "state" account. func (inst *AcceptPayeeship) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -50,7 +50,7 @@ func (inst *AcceptPayeeship) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *AcceptPayeeship) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetTransmitterAccount sets the "transmitter" account. @@ -61,7 +61,7 @@ func (inst *AcceptPayeeship) SetTransmitterAccount(transmitter ag_solanago.Publi // GetTransmitterAccount gets the "transmitter" account. func (inst *AcceptPayeeship) GetTransmitterAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetProposedPayeeAccount sets the "proposedPayee" account. @@ -72,7 +72,7 @@ func (inst *AcceptPayeeship) SetProposedPayeeAccount(proposedPayee ag_solanago.P // GetProposedPayeeAccount gets the "proposedPayee" account. func (inst *AcceptPayeeship) GetProposedPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } func (inst AcceptPayeeship) Build() *Instruction { @@ -124,10 +124,10 @@ func (inst *AcceptPayeeship) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice.Get(3))) }) }) }) diff --git a/contracts/generated/ocr2/AcceptPayeeship_test.go b/contracts/generated/ocr2/AcceptPayeeship_test.go index 6a8f5c967..66ef97b2a 100644 --- a/contracts/generated/ocr2/AcceptPayeeship_test.go +++ b/contracts/generated/ocr2/AcceptPayeeship_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/AcceptProposal.go b/contracts/generated/ocr2/AcceptProposal.go index af4398090..9b5fb37ed 100644 --- a/contracts/generated/ocr2/AcceptProposal.go +++ b/contracts/generated/ocr2/AcceptProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -27,7 +27,7 @@ type AcceptProposal struct { // [5] = [] vaultAuthority // // [6] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAcceptProposalInstructionBuilder creates a new `AcceptProposal` instruction builder. @@ -52,7 +52,7 @@ func (inst *AcceptProposal) SetStateAccount(state ag_solanago.PublicKey) *Accept // GetStateAccount gets the "state" account. func (inst *AcceptProposal) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetProposalAccount sets the "proposal" account. @@ -63,7 +63,7 @@ func (inst *AcceptProposal) SetProposalAccount(proposal ag_solanago.PublicKey) * // GetProposalAccount gets the "proposal" account. func (inst *AcceptProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetReceiverAccount sets the "receiver" account. @@ -74,7 +74,7 @@ func (inst *AcceptProposal) SetReceiverAccount(receiver ag_solanago.PublicKey) * // GetReceiverAccount gets the "receiver" account. func (inst *AcceptProposal) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetAuthorityAccount sets the "authority" account. @@ -85,7 +85,7 @@ func (inst *AcceptProposal) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *AcceptProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -96,7 +96,7 @@ func (inst *AcceptProposal) SetTokenVaultAccount(tokenVault ag_solanago.PublicKe // GetTokenVaultAccount gets the "tokenVault" account. func (inst *AcceptProposal) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -107,7 +107,7 @@ func (inst *AcceptProposal) SetVaultAuthorityAccount(vaultAuthority ag_solanago. // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *AcceptProposal) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -118,7 +118,7 @@ func (inst *AcceptProposal) SetTokenProgramAccount(tokenProgram ag_solanago.Publ // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *AcceptProposal) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[6] + return inst.AccountMetaSlice.Get(6) } func (inst AcceptProposal) Build() *Instruction { @@ -188,13 +188,13 @@ func (inst *AcceptProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice[5])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice.Get(5))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(6))) }) }) }) diff --git a/contracts/generated/ocr2/AcceptProposal_test.go b/contracts/generated/ocr2/AcceptProposal_test.go index 71e1660a0..1d085aff5 100644 --- a/contracts/generated/ocr2/AcceptProposal_test.go +++ b/contracts/generated/ocr2/AcceptProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/Close.go b/contracts/generated/ocr2/Close.go index f4dfe5f16..1018424d3 100644 --- a/contracts/generated/ocr2/Close.go +++ b/contracts/generated/ocr2/Close.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -24,7 +24,7 @@ type Close struct { // [4] = [] vaultAuthority // // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewCloseInstructionBuilder creates a new `Close` instruction builder. @@ -43,7 +43,7 @@ func (inst *Close) SetStateAccount(state ag_solanago.PublicKey) *Close { // GetStateAccount gets the "state" account. func (inst *Close) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetReceiverAccount sets the "receiver" account. @@ -54,7 +54,7 @@ func (inst *Close) SetReceiverAccount(receiver ag_solanago.PublicKey) *Close { // GetReceiverAccount gets the "receiver" account. func (inst *Close) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -65,7 +65,7 @@ func (inst *Close) SetAuthorityAccount(authority ag_solanago.PublicKey) *Close { // GetAuthorityAccount gets the "authority" account. func (inst *Close) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -76,7 +76,7 @@ func (inst *Close) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) *Close // GetTokenVaultAccount gets the "tokenVault" account. func (inst *Close) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -87,7 +87,7 @@ func (inst *Close) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *Close) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -98,7 +98,7 @@ func (inst *Close) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *C // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *Close) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } func (inst Close) Build() *Instruction { @@ -156,12 +156,12 @@ func (inst *Close) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) }) }) }) diff --git a/contracts/generated/ocr2/CloseProposal.go b/contracts/generated/ocr2/CloseProposal.go index 3f852ecf3..1adb45395 100644 --- a/contracts/generated/ocr2/CloseProposal.go +++ b/contracts/generated/ocr2/CloseProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -18,7 +18,7 @@ type CloseProposal struct { // [1] = [WRITE] receiver // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewCloseProposalInstructionBuilder creates a new `CloseProposal` instruction builder. @@ -37,7 +37,7 @@ func (inst *CloseProposal) SetProposalAccount(proposal ag_solanago.PublicKey) *C // GetProposalAccount gets the "proposal" account. func (inst *CloseProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetReceiverAccount sets the "receiver" account. @@ -48,7 +48,7 @@ func (inst *CloseProposal) SetReceiverAccount(receiver ag_solanago.PublicKey) *C // GetReceiverAccount gets the "receiver" account. func (inst *CloseProposal) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -59,7 +59,7 @@ func (inst *CloseProposal) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *CloseProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst CloseProposal) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *CloseProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/ocr2/CloseProposal_test.go b/contracts/generated/ocr2/CloseProposal_test.go index 80ffba3e6..205f1cf25 100644 --- a/contracts/generated/ocr2/CloseProposal_test.go +++ b/contracts/generated/ocr2/CloseProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/Close_test.go b/contracts/generated/ocr2/Close_test.go index 43c83073c..1dd86086b 100644 --- a/contracts/generated/ocr2/Close_test.go +++ b/contracts/generated/ocr2/Close_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/CreateProposal.go b/contracts/generated/ocr2/CreateProposal.go index 9ed55f296..de9df7930 100644 --- a/contracts/generated/ocr2/CreateProposal.go +++ b/contracts/generated/ocr2/CreateProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -17,7 +17,7 @@ type CreateProposal struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewCreateProposalInstructionBuilder creates a new `CreateProposal` instruction builder. @@ -42,7 +42,7 @@ func (inst *CreateProposal) SetProposalAccount(proposal ag_solanago.PublicKey) * // GetProposalAccount gets the "proposal" account. func (inst *CreateProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *CreateProposal) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *CreateProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst CreateProposal) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *CreateProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/CreateProposal_test.go b/contracts/generated/ocr2/CreateProposal_test.go index 7c769350b..89f18f149 100644 --- a/contracts/generated/ocr2/CreateProposal_test.go +++ b/contracts/generated/ocr2/CreateProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/FinalizeProposal.go b/contracts/generated/ocr2/FinalizeProposal.go index 92bad057c..5abd17d97 100644 --- a/contracts/generated/ocr2/FinalizeProposal.go +++ b/contracts/generated/ocr2/FinalizeProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -16,7 +16,7 @@ type FinalizeProposal struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewFinalizeProposalInstructionBuilder creates a new `FinalizeProposal` instruction builder. @@ -35,7 +35,7 @@ func (inst *FinalizeProposal) SetProposalAccount(proposal ag_solanago.PublicKey) // GetProposalAccount gets the "proposal" account. func (inst *FinalizeProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *FinalizeProposal) SetAuthorityAccount(authority ag_solanago.PublicKe // GetAuthorityAccount gets the "authority" account. func (inst *FinalizeProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst FinalizeProposal) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *FinalizeProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/FinalizeProposal_test.go b/contracts/generated/ocr2/FinalizeProposal_test.go index 04552a616..43e74f84b 100644 --- a/contracts/generated/ocr2/FinalizeProposal_test.go +++ b/contracts/generated/ocr2/FinalizeProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/Initialize.go b/contracts/generated/ocr2/Initialize.go index 472075dd2..b9cf89e98 100644 --- a/contracts/generated/ocr2/Initialize.go +++ b/contracts/generated/ocr2/Initialize.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -40,7 +40,7 @@ type Initialize struct { // [11] = [] tokenProgram // // [12] = [] associatedTokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. @@ -71,7 +71,7 @@ func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize // GetStateAccount gets the "state" account. func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetFeedAccount sets the "feed" account. @@ -82,7 +82,7 @@ func (inst *Initialize) SetFeedAccount(feed ag_solanago.PublicKey) *Initialize { // GetFeedAccount gets the "feed" account. func (inst *Initialize) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetPayerAccount sets the "payer" account. @@ -93,7 +93,7 @@ func (inst *Initialize) SetPayerAccount(payer ag_solanago.PublicKey) *Initialize // GetPayerAccount gets the "payer" account. func (inst *Initialize) GetPayerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetOwnerAccount sets the "owner" account. @@ -104,7 +104,7 @@ func (inst *Initialize) SetOwnerAccount(owner ag_solanago.PublicKey) *Initialize // GetOwnerAccount gets the "owner" account. func (inst *Initialize) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetTokenMintAccount sets the "tokenMint" account. @@ -115,7 +115,7 @@ func (inst *Initialize) SetTokenMintAccount(tokenMint ag_solanago.PublicKey) *In // GetTokenMintAccount gets the "tokenMint" account. func (inst *Initialize) GetTokenMintAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -126,7 +126,7 @@ func (inst *Initialize) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) * // GetTokenVaultAccount gets the "tokenVault" account. func (inst *Initialize) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -137,7 +137,7 @@ func (inst *Initialize) SetVaultAuthorityAccount(vaultAuthority ag_solanago.Publ // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *Initialize) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[6] + return inst.AccountMetaSlice.Get(6) } // SetRequesterAccessControllerAccount sets the "requesterAccessController" account. @@ -148,7 +148,7 @@ func (inst *Initialize) SetRequesterAccessControllerAccount(requesterAccessContr // GetRequesterAccessControllerAccount gets the "requesterAccessController" account. func (inst *Initialize) GetRequesterAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[7] + return inst.AccountMetaSlice.Get(7) } // SetBillingAccessControllerAccount sets the "billingAccessController" account. @@ -159,7 +159,7 @@ func (inst *Initialize) SetBillingAccessControllerAccount(billingAccessControlle // GetBillingAccessControllerAccount gets the "billingAccessController" account. func (inst *Initialize) GetBillingAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[8] + return inst.AccountMetaSlice.Get(8) } // SetRentAccount sets the "rent" account. @@ -170,7 +170,7 @@ func (inst *Initialize) SetRentAccount(rent ag_solanago.PublicKey) *Initialize { // GetRentAccount gets the "rent" account. func (inst *Initialize) GetRentAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[9] + return inst.AccountMetaSlice.Get(9) } // SetSystemProgramAccount sets the "systemProgram" account. @@ -181,7 +181,7 @@ func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.Public // GetSystemProgramAccount gets the "systemProgram" account. func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[10] + return inst.AccountMetaSlice.Get(10) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -192,7 +192,7 @@ func (inst *Initialize) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKe // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *Initialize) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[11] + return inst.AccountMetaSlice.Get(11) } // SetAssociatedTokenProgramAccount sets the "associatedTokenProgram" account. @@ -203,7 +203,7 @@ func (inst *Initialize) SetAssociatedTokenProgramAccount(associatedTokenProgram // GetAssociatedTokenProgramAccount gets the "associatedTokenProgram" account. func (inst *Initialize) GetAssociatedTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[12] + return inst.AccountMetaSlice.Get(12) } func (inst Initialize) Build() *Instruction { @@ -295,19 +295,19 @@ func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=13]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" payer", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta(" tokenMint", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[5])) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[6])) - accountsBranch.Child(ag_format.Meta("requesterAccessController", inst.AccountMetaSlice[7])) - accountsBranch.Child(ag_format.Meta(" billingAccessController", inst.AccountMetaSlice[8])) - accountsBranch.Child(ag_format.Meta(" rent", inst.AccountMetaSlice[9])) - accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice[10])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[11])) - accountsBranch.Child(ag_format.Meta(" associatedTokenProgram", inst.AccountMetaSlice[12])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" payer", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" tokenMint", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(5))) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(6))) + accountsBranch.Child(ag_format.Meta("requesterAccessController", inst.AccountMetaSlice.Get(7))) + accountsBranch.Child(ag_format.Meta(" billingAccessController", inst.AccountMetaSlice.Get(8))) + accountsBranch.Child(ag_format.Meta(" rent", inst.AccountMetaSlice.Get(9))) + accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice.Get(10))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(11))) + accountsBranch.Child(ag_format.Meta(" associatedTokenProgram", inst.AccountMetaSlice.Get(12))) }) }) }) diff --git a/contracts/generated/ocr2/Initialize_test.go b/contracts/generated/ocr2/Initialize_test.go index e007c15fe..d87fdfea9 100644 --- a/contracts/generated/ocr2/Initialize_test.go +++ b/contracts/generated/ocr2/Initialize_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/PayOracles.go b/contracts/generated/ocr2/PayOracles.go index 9a6a69a5f..dfd8762bc 100644 --- a/contracts/generated/ocr2/PayOracles.go +++ b/contracts/generated/ocr2/PayOracles.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -24,7 +24,7 @@ type PayOracles struct { // [4] = [] vaultAuthority // // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewPayOraclesInstructionBuilder creates a new `PayOracles` instruction builder. @@ -43,7 +43,7 @@ func (inst *PayOracles) SetStateAccount(state ag_solanago.PublicKey) *PayOracles // GetStateAccount gets the "state" account. func (inst *PayOracles) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -54,7 +54,7 @@ func (inst *PayOracles) SetAuthorityAccount(authority ag_solanago.PublicKey) *Pa // GetAuthorityAccount gets the "authority" account. func (inst *PayOracles) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -65,7 +65,7 @@ func (inst *PayOracles) SetAccessControllerAccount(accessController ag_solanago. // GetAccessControllerAccount gets the "accessController" account. func (inst *PayOracles) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -76,7 +76,7 @@ func (inst *PayOracles) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) * // GetTokenVaultAccount gets the "tokenVault" account. func (inst *PayOracles) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -87,7 +87,7 @@ func (inst *PayOracles) SetVaultAuthorityAccount(vaultAuthority ag_solanago.Publ // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *PayOracles) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -98,7 +98,7 @@ func (inst *PayOracles) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKe // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *PayOracles) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } func (inst PayOracles) Build() *Instruction { @@ -156,12 +156,12 @@ func (inst *PayOracles) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) }) }) }) diff --git a/contracts/generated/ocr2/PayOracles_test.go b/contracts/generated/ocr2/PayOracles_test.go index 9755c339c..ce8dbdb81 100644 --- a/contracts/generated/ocr2/PayOracles_test.go +++ b/contracts/generated/ocr2/PayOracles_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/ProposeConfig.go b/contracts/generated/ocr2/ProposeConfig.go index 4fb2783d9..468c428d6 100644 --- a/contracts/generated/ocr2/ProposeConfig.go +++ b/contracts/generated/ocr2/ProposeConfig.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -18,7 +18,7 @@ type ProposeConfig struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewProposeConfigInstructionBuilder creates a new `ProposeConfig` instruction builder. @@ -49,7 +49,7 @@ func (inst *ProposeConfig) SetProposalAccount(proposal ag_solanago.PublicKey) *P // GetProposalAccount gets the "proposal" account. func (inst *ProposeConfig) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -60,7 +60,7 @@ func (inst *ProposeConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *ProposeConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst ProposeConfig) Build() *Instruction { @@ -119,8 +119,8 @@ func (inst *ProposeConfig) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/ProposeConfig_test.go b/contracts/generated/ocr2/ProposeConfig_test.go index 202ff02aa..937c5ef48 100644 --- a/contracts/generated/ocr2/ProposeConfig_test.go +++ b/contracts/generated/ocr2/ProposeConfig_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/ProposePayees.go b/contracts/generated/ocr2/ProposePayees.go index 9d7f461a6..f6bec3bd1 100644 --- a/contracts/generated/ocr2/ProposePayees.go +++ b/contracts/generated/ocr2/ProposePayees.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -13,12 +13,11 @@ import ( // ProposePayees is the `proposePayees` instruction. type ProposePayees struct { TokenMint *ag_solanago.PublicKey - Payees *[]ag_solanago.PublicKey // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewProposePayeesInstructionBuilder creates a new `ProposePayees` instruction builder. @@ -35,12 +34,6 @@ func (inst *ProposePayees) SetTokenMint(tokenMint ag_solanago.PublicKey) *Propos return inst } -// SetPayees sets the "payees" parameter. -func (inst *ProposePayees) SetPayees(payees []ag_solanago.PublicKey) *ProposePayees { - inst.Payees = &payees - return inst -} - // SetProposalAccount sets the "proposal" account. func (inst *ProposePayees) SetProposalAccount(proposal ag_solanago.PublicKey) *ProposePayees { inst.AccountMetaSlice[0] = ag_solanago.Meta(proposal).WRITE() @@ -49,7 +42,7 @@ func (inst *ProposePayees) SetProposalAccount(proposal ag_solanago.PublicKey) *P // GetProposalAccount gets the "proposal" account. func (inst *ProposePayees) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -60,7 +53,7 @@ func (inst *ProposePayees) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *ProposePayees) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst ProposePayees) Build() *Instruction { @@ -86,9 +79,6 @@ func (inst *ProposePayees) Validate() error { if inst.TokenMint == nil { return errors.New("TokenMint parameter is not set") } - if inst.Payees == nil { - return errors.New("Payees parameter is not set") - } } // Check whether all (required) accounts are set: @@ -112,15 +102,14 @@ func (inst *ProposePayees) EncodeToTree(parent ag_treeout.Branches) { ParentFunc(func(instructionBranch ag_treeout.Branches) { // Parameters of the instruction: - instructionBranch.Child("Params[len=2]").ParentFunc(func(paramsBranch ag_treeout.Branches) { + instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) { paramsBranch.Child(ag_format.Param("TokenMint", *inst.TokenMint)) - paramsBranch.Child(ag_format.Param(" Payees", *inst.Payees)) }) // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) @@ -132,11 +121,6 @@ func (obj ProposePayees) MarshalWithEncoder(encoder *ag_binary.Encoder) (err err if err != nil { return err } - // Serialize `Payees` param: - err = encoder.Encode(obj.Payees) - if err != nil { - return err - } return nil } func (obj *ProposePayees) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { @@ -145,11 +129,6 @@ func (obj *ProposePayees) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err if err != nil { return err } - // Deserialize `Payees`: - err = decoder.Decode(&obj.Payees) - if err != nil { - return err - } return nil } @@ -157,13 +136,11 @@ func (obj *ProposePayees) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err func NewProposePayeesInstruction( // Parameters: tokenMint ag_solanago.PublicKey, - payees []ag_solanago.PublicKey, // Accounts: proposal ag_solanago.PublicKey, authority ag_solanago.PublicKey) *ProposePayees { return NewProposePayeesInstructionBuilder(). SetTokenMint(tokenMint). - SetPayees(payees). SetProposalAccount(proposal). SetAuthorityAccount(authority) } diff --git a/contracts/generated/ocr2/ProposePayees_test.go b/contracts/generated/ocr2/ProposePayees_test.go index e481ff962..fff1d8e90 100644 --- a/contracts/generated/ocr2/ProposePayees_test.go +++ b/contracts/generated/ocr2/ProposePayees_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/RequestNewRound.go b/contracts/generated/ocr2/RequestNewRound.go index 123222300..62a9dd07f 100644 --- a/contracts/generated/ocr2/RequestNewRound.go +++ b/contracts/generated/ocr2/RequestNewRound.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -18,7 +18,7 @@ type RequestNewRound struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewRequestNewRoundInstructionBuilder creates a new `RequestNewRound` instruction builder. @@ -37,7 +37,7 @@ func (inst *RequestNewRound) SetStateAccount(state ag_solanago.PublicKey) *Reque // GetStateAccount gets the "state" account. func (inst *RequestNewRound) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *RequestNewRound) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *RequestNewRound) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *RequestNewRound) SetAccessControllerAccount(accessController ag_sola // GetAccessControllerAccount gets the "accessController" account. func (inst *RequestNewRound) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst RequestNewRound) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *RequestNewRound) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/ocr2/RequestNewRound_test.go b/contracts/generated/ocr2/RequestNewRound_test.go index 16ba010d8..fa5cd68a3 100644 --- a/contracts/generated/ocr2/RequestNewRound_test.go +++ b/contracts/generated/ocr2/RequestNewRound_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/SetBilling.go b/contracts/generated/ocr2/SetBilling.go index 1256c86dc..ba9e79ce9 100644 --- a/contracts/generated/ocr2/SetBilling.go +++ b/contracts/generated/ocr2/SetBilling.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -26,7 +26,7 @@ type SetBilling struct { // [4] = [] vaultAuthority // // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSetBillingInstructionBuilder creates a new `SetBilling` instruction builder. @@ -57,7 +57,7 @@ func (inst *SetBilling) SetStateAccount(state ag_solanago.PublicKey) *SetBilling // GetStateAccount gets the "state" account. func (inst *SetBilling) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -68,7 +68,7 @@ func (inst *SetBilling) SetAuthorityAccount(authority ag_solanago.PublicKey) *Se // GetAuthorityAccount gets the "authority" account. func (inst *SetBilling) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -79,7 +79,7 @@ func (inst *SetBilling) SetAccessControllerAccount(accessController ag_solanago. // GetAccessControllerAccount gets the "accessController" account. func (inst *SetBilling) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -90,7 +90,7 @@ func (inst *SetBilling) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) * // GetTokenVaultAccount gets the "tokenVault" account. func (inst *SetBilling) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -101,7 +101,7 @@ func (inst *SetBilling) SetVaultAuthorityAccount(vaultAuthority ag_solanago.Publ // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *SetBilling) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -112,7 +112,7 @@ func (inst *SetBilling) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKe // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *SetBilling) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } func (inst SetBilling) Build() *Instruction { @@ -183,12 +183,12 @@ func (inst *SetBilling) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) }) }) }) diff --git a/contracts/generated/ocr2/SetBillingAccessController.go b/contracts/generated/ocr2/SetBillingAccessController.go index 89017f089..34b0392ac 100644 --- a/contracts/generated/ocr2/SetBillingAccessController.go +++ b/contracts/generated/ocr2/SetBillingAccessController.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -18,7 +18,7 @@ type SetBillingAccessController struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSetBillingAccessControllerInstructionBuilder creates a new `SetBillingAccessController` instruction builder. @@ -37,7 +37,7 @@ func (inst *SetBillingAccessController) SetStateAccount(state ag_solanago.Public // GetStateAccount gets the "state" account. func (inst *SetBillingAccessController) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *SetBillingAccessController) SetAuthorityAccount(authority ag_solanag // GetAuthorityAccount gets the "authority" account. func (inst *SetBillingAccessController) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *SetBillingAccessController) SetAccessControllerAccount(accessControl // GetAccessControllerAccount gets the "accessController" account. func (inst *SetBillingAccessController) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst SetBillingAccessController) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *SetBillingAccessController) EncodeToTree(parent ag_treeout.Branches) // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/ocr2/SetBillingAccessController_test.go b/contracts/generated/ocr2/SetBillingAccessController_test.go index 2c6efde1f..4d73910ac 100644 --- a/contracts/generated/ocr2/SetBillingAccessController_test.go +++ b/contracts/generated/ocr2/SetBillingAccessController_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/SetBilling_test.go b/contracts/generated/ocr2/SetBilling_test.go index e4d00c397..84882d6a7 100644 --- a/contracts/generated/ocr2/SetBilling_test.go +++ b/contracts/generated/ocr2/SetBilling_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/SetRequesterAccessController.go b/contracts/generated/ocr2/SetRequesterAccessController.go index f9587dc70..f80a34a49 100644 --- a/contracts/generated/ocr2/SetRequesterAccessController.go +++ b/contracts/generated/ocr2/SetRequesterAccessController.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -18,7 +18,7 @@ type SetRequesterAccessController struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSetRequesterAccessControllerInstructionBuilder creates a new `SetRequesterAccessController` instruction builder. @@ -37,7 +37,7 @@ func (inst *SetRequesterAccessController) SetStateAccount(state ag_solanago.Publ // GetStateAccount gets the "state" account. func (inst *SetRequesterAccessController) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *SetRequesterAccessController) SetAuthorityAccount(authority ag_solan // GetAuthorityAccount gets the "authority" account. func (inst *SetRequesterAccessController) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *SetRequesterAccessController) SetAccessControllerAccount(accessContr // GetAccessControllerAccount gets the "accessController" account. func (inst *SetRequesterAccessController) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst SetRequesterAccessController) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *SetRequesterAccessController) EncodeToTree(parent ag_treeout.Branche // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/ocr2/SetRequesterAccessController_test.go b/contracts/generated/ocr2/SetRequesterAccessController_test.go index ae14b2453..c2965c0b2 100644 --- a/contracts/generated/ocr2/SetRequesterAccessController_test.go +++ b/contracts/generated/ocr2/SetRequesterAccessController_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/TransferOwnership.go b/contracts/generated/ocr2/TransferOwnership.go index 8168fd378..de8bb5511 100644 --- a/contracts/generated/ocr2/TransferOwnership.go +++ b/contracts/generated/ocr2/TransferOwnership.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -17,7 +17,7 @@ type TransferOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. @@ -42,7 +42,7 @@ func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *Tra // GetStateAccount gets the "state" account. func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicK // GetAuthorityAccount gets the "authority" account. func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst TransferOwnership) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/TransferOwnership_test.go b/contracts/generated/ocr2/TransferOwnership_test.go index 2bbdd9fb1..580f53962 100644 --- a/contracts/generated/ocr2/TransferOwnership_test.go +++ b/contracts/generated/ocr2/TransferOwnership_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/TransferPayeeship.go b/contracts/generated/ocr2/TransferPayeeship.go index 1eb5e1bb7..f24cc2708 100644 --- a/contracts/generated/ocr2/TransferPayeeship.go +++ b/contracts/generated/ocr2/TransferPayeeship.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -22,7 +22,7 @@ type TransferPayeeship struct { // [3] = [] payee // // [4] = [] proposedPayee - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewTransferPayeeshipInstructionBuilder creates a new `TransferPayeeship` instruction builder. @@ -41,7 +41,7 @@ func (inst *TransferPayeeship) SetStateAccount(state ag_solanago.PublicKey) *Tra // GetStateAccount gets the "state" account. func (inst *TransferPayeeship) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -52,7 +52,7 @@ func (inst *TransferPayeeship) SetAuthorityAccount(authority ag_solanago.PublicK // GetAuthorityAccount gets the "authority" account. func (inst *TransferPayeeship) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetTransmitterAccount sets the "transmitter" account. @@ -63,7 +63,7 @@ func (inst *TransferPayeeship) SetTransmitterAccount(transmitter ag_solanago.Pub // GetTransmitterAccount gets the "transmitter" account. func (inst *TransferPayeeship) GetTransmitterAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetPayeeAccount sets the "payee" account. @@ -74,7 +74,7 @@ func (inst *TransferPayeeship) SetPayeeAccount(payee ag_solanago.PublicKey) *Tra // GetPayeeAccount gets the "payee" account. func (inst *TransferPayeeship) GetPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetProposedPayeeAccount sets the "proposedPayee" account. @@ -85,7 +85,7 @@ func (inst *TransferPayeeship) SetProposedPayeeAccount(proposedPayee ag_solanago // GetProposedPayeeAccount gets the "proposedPayee" account. func (inst *TransferPayeeship) GetProposedPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } func (inst TransferPayeeship) Build() *Instruction { @@ -140,11 +140,11 @@ func (inst *TransferPayeeship) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice.Get(4))) }) }) }) diff --git a/contracts/generated/ocr2/TransferPayeeship_test.go b/contracts/generated/ocr2/TransferPayeeship_test.go index 1928c73c2..76c4e0427 100644 --- a/contracts/generated/ocr2/TransferPayeeship_test.go +++ b/contracts/generated/ocr2/TransferPayeeship_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/WithdrawFunds.go b/contracts/generated/ocr2/WithdrawFunds.go index c2f8629a3..c667b4ef4 100644 --- a/contracts/generated/ocr2/WithdrawFunds.go +++ b/contracts/generated/ocr2/WithdrawFunds.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -27,7 +27,7 @@ type WithdrawFunds struct { // [5] = [WRITE] recipient // // [6] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewWithdrawFundsInstructionBuilder creates a new `WithdrawFunds` instruction builder. @@ -52,7 +52,7 @@ func (inst *WithdrawFunds) SetStateAccount(state ag_solanago.PublicKey) *Withdra // GetStateAccount gets the "state" account. func (inst *WithdrawFunds) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -63,7 +63,7 @@ func (inst *WithdrawFunds) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *WithdrawFunds) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -74,7 +74,7 @@ func (inst *WithdrawFunds) SetAccessControllerAccount(accessController ag_solana // GetAccessControllerAccount gets the "accessController" account. func (inst *WithdrawFunds) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -85,7 +85,7 @@ func (inst *WithdrawFunds) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey // GetTokenVaultAccount gets the "tokenVault" account. func (inst *WithdrawFunds) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -96,7 +96,7 @@ func (inst *WithdrawFunds) SetVaultAuthorityAccount(vaultAuthority ag_solanago.P // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *WithdrawFunds) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetRecipientAccount sets the "recipient" account. @@ -107,7 +107,7 @@ func (inst *WithdrawFunds) SetRecipientAccount(recipient ag_solanago.PublicKey) // GetRecipientAccount gets the "recipient" account. func (inst *WithdrawFunds) GetRecipientAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -118,7 +118,7 @@ func (inst *WithdrawFunds) SetTokenProgramAccount(tokenProgram ag_solanago.Publi // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *WithdrawFunds) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[6] + return inst.AccountMetaSlice.Get(6) } func (inst WithdrawFunds) Build() *Instruction { @@ -188,13 +188,13 @@ func (inst *WithdrawFunds) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta(" recipient", inst.AccountMetaSlice[5])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" recipient", inst.AccountMetaSlice.Get(5))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(6))) }) }) }) diff --git a/contracts/generated/ocr2/WithdrawFunds_test.go b/contracts/generated/ocr2/WithdrawFunds_test.go index e7644d18d..6c5cc6b04 100644 --- a/contracts/generated/ocr2/WithdrawFunds_test.go +++ b/contracts/generated/ocr2/WithdrawFunds_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/WithdrawPayment.go b/contracts/generated/ocr2/WithdrawPayment.go index f8b1fefab..b62568460 100644 --- a/contracts/generated/ocr2/WithdrawPayment.go +++ b/contracts/generated/ocr2/WithdrawPayment.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -24,7 +24,7 @@ type WithdrawPayment struct { // [4] = [WRITE] payee // // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewWithdrawPaymentInstructionBuilder creates a new `WithdrawPayment` instruction builder. @@ -43,7 +43,7 @@ func (inst *WithdrawPayment) SetStateAccount(state ag_solanago.PublicKey) *Withd // GetStateAccount gets the "state" account. func (inst *WithdrawPayment) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -54,7 +54,7 @@ func (inst *WithdrawPayment) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *WithdrawPayment) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetTokenVaultAccount sets the "tokenVault" account. @@ -65,7 +65,7 @@ func (inst *WithdrawPayment) SetTokenVaultAccount(tokenVault ag_solanago.PublicK // GetTokenVaultAccount gets the "tokenVault" account. func (inst *WithdrawPayment) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -76,7 +76,7 @@ func (inst *WithdrawPayment) SetVaultAuthorityAccount(vaultAuthority ag_solanago // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *WithdrawPayment) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } // SetPayeeAccount sets the "payee" account. @@ -87,7 +87,7 @@ func (inst *WithdrawPayment) SetPayeeAccount(payee ag_solanago.PublicKey) *Withd // GetPayeeAccount gets the "payee" account. func (inst *WithdrawPayment) GetPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[4] + return inst.AccountMetaSlice.Get(4) } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -98,7 +98,7 @@ func (inst *WithdrawPayment) SetTokenProgramAccount(tokenProgram ag_solanago.Pub // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *WithdrawPayment) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[5] + return inst.AccountMetaSlice.Get(5) } func (inst WithdrawPayment) Build() *Instruction { @@ -156,12 +156,12 @@ func (inst *WithdrawPayment) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice[3])) - accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice[4])) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) }) }) }) diff --git a/contracts/generated/ocr2/WithdrawPayment_test.go b/contracts/generated/ocr2/WithdrawPayment_test.go index f2d9e624f..0e3d5a85e 100644 --- a/contracts/generated/ocr2/WithdrawPayment_test.go +++ b/contracts/generated/ocr2/WithdrawPayment_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/WriteOffchainConfig.go b/contracts/generated/ocr2/WriteOffchainConfig.go index 4606ce8cd..17c098171 100644 --- a/contracts/generated/ocr2/WriteOffchainConfig.go +++ b/contracts/generated/ocr2/WriteOffchainConfig.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "errors" @@ -17,7 +17,7 @@ type WriteOffchainConfig struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewWriteOffchainConfigInstructionBuilder creates a new `WriteOffchainConfig` instruction builder. @@ -42,7 +42,7 @@ func (inst *WriteOffchainConfig) SetProposalAccount(proposal ag_solanago.PublicK // GetProposalAccount gets the "proposal" account. func (inst *WriteOffchainConfig) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *WriteOffchainConfig) SetAuthorityAccount(authority ag_solanago.Publi // GetAuthorityAccount gets the "authority" account. func (inst *WriteOffchainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst WriteOffchainConfig) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *WriteOffchainConfig) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/ocr2/WriteOffchainConfig_test.go b/contracts/generated/ocr2/WriteOffchainConfig_test.go index 8a9c917e1..16b8aed1a 100644 --- a/contracts/generated/ocr2/WriteOffchainConfig_test.go +++ b/contracts/generated/ocr2/WriteOffchainConfig_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/accounts.go b/contracts/generated/ocr2/accounts.go index 71627c0d9..724fd9e16 100644 --- a/contracts/generated/ocr2/accounts.go +++ b/contracts/generated/ocr2/accounts.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "fmt" diff --git a/contracts/generated/ocr2/instructions.go b/contracts/generated/ocr2/instructions.go index c38fde6db..2dc0c1598 100644 --- a/contracts/generated/ocr2/instructions.go +++ b/contracts/generated/ocr2/instructions.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/testing_utils.go b/contracts/generated/ocr2/testing_utils.go index 3b5eb4e93..4e270a6ed 100644 --- a/contracts/generated/ocr2/testing_utils.go +++ b/contracts/generated/ocr2/testing_utils.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( "bytes" diff --git a/contracts/generated/ocr2/types.go b/contracts/generated/ocr2/types.go index 53906e7fc..ae5c1a040 100644 --- a/contracts/generated/ocr2/types.go +++ b/contracts/generated/ocr2/types.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr_2 +package ocr2 import ( ag_binary "github.com/gagliardetto/binary" diff --git a/contracts/generated/store/AcceptFeedOwnership.go b/contracts/generated/store/AcceptFeedOwnership.go index 8c958bebb..2e4515863 100644 --- a/contracts/generated/store/AcceptFeedOwnership.go +++ b/contracts/generated/store/AcceptFeedOwnership.go @@ -18,7 +18,7 @@ type AcceptFeedOwnership struct { // [1] = [] proposedOwner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAcceptFeedOwnershipInstructionBuilder creates a new `AcceptFeedOwnership` instruction builder. @@ -37,7 +37,7 @@ func (inst *AcceptFeedOwnership) SetFeedAccount(feed ag_solanago.PublicKey) *Acc // GetFeedAccount gets the "feed" account. func (inst *AcceptFeedOwnership) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetProposedOwnerAccount sets the "proposedOwner" account. @@ -48,7 +48,7 @@ func (inst *AcceptFeedOwnership) SetProposedOwnerAccount(proposedOwner ag_solana // GetProposedOwnerAccount gets the "proposedOwner" account. func (inst *AcceptFeedOwnership) GetProposedOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -59,7 +59,7 @@ func (inst *AcceptFeedOwnership) SetAuthorityAccount(authority ag_solanago.Publi // GetAuthorityAccount gets the "authority" account. func (inst *AcceptFeedOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst AcceptFeedOwnership) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *AcceptFeedOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("proposedOwner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("proposedOwner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/store/AcceptStoreOwnership.go b/contracts/generated/store/AcceptStoreOwnership.go index b7176ddbc..346da347e 100644 --- a/contracts/generated/store/AcceptStoreOwnership.go +++ b/contracts/generated/store/AcceptStoreOwnership.go @@ -16,7 +16,7 @@ type AcceptStoreOwnership struct { // [0] = [WRITE] store // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewAcceptStoreOwnershipInstructionBuilder creates a new `AcceptStoreOwnership` instruction builder. @@ -35,7 +35,7 @@ func (inst *AcceptStoreOwnership) SetStoreAccount(store ag_solanago.PublicKey) * // GetStoreAccount gets the "store" account. func (inst *AcceptStoreOwnership) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *AcceptStoreOwnership) SetAuthorityAccount(authority ag_solanago.Publ // GetAuthorityAccount gets the "authority" account. func (inst *AcceptStoreOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst AcceptStoreOwnership) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *AcceptStoreOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/store/CloseFeed.go b/contracts/generated/store/CloseFeed.go index bf411b454..f64dfcd77 100644 --- a/contracts/generated/store/CloseFeed.go +++ b/contracts/generated/store/CloseFeed.go @@ -20,7 +20,7 @@ type CloseFeed struct { // [2] = [WRITE] receiver // // [3] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewCloseFeedInstructionBuilder creates a new `CloseFeed` instruction builder. @@ -39,7 +39,7 @@ func (inst *CloseFeed) SetFeedAccount(feed ag_solanago.PublicKey) *CloseFeed { // GetFeedAccount gets the "feed" account. func (inst *CloseFeed) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -50,7 +50,7 @@ func (inst *CloseFeed) SetOwnerAccount(owner ag_solanago.PublicKey) *CloseFeed { // GetOwnerAccount gets the "owner" account. func (inst *CloseFeed) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetReceiverAccount sets the "receiver" account. @@ -61,7 +61,7 @@ func (inst *CloseFeed) SetReceiverAccount(receiver ag_solanago.PublicKey) *Close // GetReceiverAccount gets the "receiver" account. func (inst *CloseFeed) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetAuthorityAccount sets the "authority" account. @@ -72,7 +72,7 @@ func (inst *CloseFeed) SetAuthorityAccount(authority ag_solanago.PublicKey) *Clo // GetAuthorityAccount gets the "authority" account. func (inst *CloseFeed) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } func (inst CloseFeed) Build() *Instruction { @@ -124,10 +124,10 @@ func (inst *CloseFeed) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(3))) }) }) }) diff --git a/contracts/generated/store/CreateFeed.go b/contracts/generated/store/CreateFeed.go index 20aecbd83..d6aa494a2 100644 --- a/contracts/generated/store/CreateFeed.go +++ b/contracts/generated/store/CreateFeed.go @@ -20,7 +20,7 @@ type CreateFeed struct { // [0] = [WRITE] feed // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewCreateFeedInstructionBuilder creates a new `CreateFeed` instruction builder. @@ -63,7 +63,7 @@ func (inst *CreateFeed) SetFeedAccount(feed ag_solanago.PublicKey) *CreateFeed { // GetFeedAccount gets the "feed" account. func (inst *CreateFeed) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -74,7 +74,7 @@ func (inst *CreateFeed) SetAuthorityAccount(authority ag_solanago.PublicKey) *Cr // GetAuthorityAccount gets the "authority" account. func (inst *CreateFeed) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst CreateFeed) Build() *Instruction { @@ -141,8 +141,8 @@ func (inst *CreateFeed) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/store/Initialize.go b/contracts/generated/store/Initialize.go index bf45fc7a6..fc0430fe9 100644 --- a/contracts/generated/store/Initialize.go +++ b/contracts/generated/store/Initialize.go @@ -18,7 +18,7 @@ type Initialize struct { // [1] = [SIGNER] owner // // [2] = [] loweringAccessController - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. @@ -37,7 +37,7 @@ func (inst *Initialize) SetStoreAccount(store ag_solanago.PublicKey) *Initialize // GetStoreAccount gets the "store" account. func (inst *Initialize) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -48,7 +48,7 @@ func (inst *Initialize) SetOwnerAccount(owner ag_solanago.PublicKey) *Initialize // GetOwnerAccount gets the "owner" account. func (inst *Initialize) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetLoweringAccessControllerAccount sets the "loweringAccessController" account. @@ -59,7 +59,7 @@ func (inst *Initialize) SetLoweringAccessControllerAccount(loweringAccessControl // GetLoweringAccessControllerAccount gets the "loweringAccessController" account. func (inst *Initialize) GetLoweringAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst Initialize) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("loweringAccessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("loweringAccessController", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/store/LowerFlag.go b/contracts/generated/store/LowerFlag.go index 4e634b4ec..19b0656b8 100644 --- a/contracts/generated/store/LowerFlag.go +++ b/contracts/generated/store/LowerFlag.go @@ -20,7 +20,7 @@ type LowerFlag struct { // [2] = [SIGNER] authority // // [3] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewLowerFlagInstructionBuilder creates a new `LowerFlag` instruction builder. @@ -39,7 +39,7 @@ func (inst *LowerFlag) SetFeedAccount(feed ag_solanago.PublicKey) *LowerFlag { // GetFeedAccount gets the "feed" account. func (inst *LowerFlag) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -50,7 +50,7 @@ func (inst *LowerFlag) SetOwnerAccount(owner ag_solanago.PublicKey) *LowerFlag { // GetOwnerAccount gets the "owner" account. func (inst *LowerFlag) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -61,7 +61,7 @@ func (inst *LowerFlag) SetAuthorityAccount(authority ag_solanago.PublicKey) *Low // GetAuthorityAccount gets the "authority" account. func (inst *LowerFlag) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } // SetAccessControllerAccount sets the "accessController" account. @@ -72,7 +72,7 @@ func (inst *LowerFlag) SetAccessControllerAccount(accessController ag_solanago.P // GetAccessControllerAccount gets the "accessController" account. func (inst *LowerFlag) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[3] + return inst.AccountMetaSlice.Get(3) } func (inst LowerFlag) Build() *Instruction { @@ -124,10 +124,10 @@ func (inst *LowerFlag) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(3))) }) }) }) diff --git a/contracts/generated/store/Query.go b/contracts/generated/store/Query.go index 01f11e98c..dcda56832 100644 --- a/contracts/generated/store/Query.go +++ b/contracts/generated/store/Query.go @@ -16,7 +16,7 @@ type Query struct { Scope Scope // [0] = [] feed - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewQueryInstructionBuilder creates a new `Query` instruction builder. @@ -41,7 +41,7 @@ func (inst *Query) SetFeedAccount(feed ag_solanago.PublicKey) *Query { // GetFeedAccount gets the "feed" account. func (inst *Query) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } func (inst Query) Build() *Instruction { @@ -93,7 +93,7 @@ func (inst *Query) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta("feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("feed", inst.AccountMetaSlice.Get(0))) }) }) }) @@ -104,22 +104,22 @@ func (obj Query) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { { tmp := scopeContainer{} switch realvalue := obj.Scope.(type) { - case *Version: + case *ScopeVersion: tmp.Enum = 0 tmp.Version = *realvalue - case *Decimals: + case *ScopeDecimals: tmp.Enum = 1 tmp.Decimals = *realvalue - case *Description: + case *ScopeDescription: tmp.Enum = 2 tmp.Description = *realvalue - case *RoundData: + case *ScopeRoundData: tmp.Enum = 3 tmp.RoundData = *realvalue - case *LatestRoundData: + case *ScopeLatestRoundData: tmp.Enum = 4 tmp.LatestRoundData = *realvalue - case *Aggregator: + case *ScopeAggregator: tmp.Enum = 5 tmp.Aggregator = *realvalue } @@ -140,17 +140,17 @@ func (obj *Query) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { } switch tmp.Enum { case 0: - obj.Scope = (*Version)(&tmp.Enum) + obj.Scope = (*ScopeVersion)(&tmp.Enum) case 1: - obj.Scope = (*Decimals)(&tmp.Enum) + obj.Scope = (*ScopeDecimals)(&tmp.Enum) case 2: - obj.Scope = (*Description)(&tmp.Enum) + obj.Scope = (*ScopeDescription)(&tmp.Enum) case 3: obj.Scope = &tmp.RoundData case 4: - obj.Scope = (*LatestRoundData)(&tmp.Enum) + obj.Scope = (*ScopeLatestRoundData)(&tmp.Enum) case 5: - obj.Scope = (*Aggregator)(&tmp.Enum) + obj.Scope = (*ScopeAggregator)(&tmp.Enum) default: return fmt.Errorf("unknown enum index: %v", tmp.Enum) } diff --git a/contracts/generated/store/SetLoweringAccessController.go b/contracts/generated/store/SetLoweringAccessController.go index c31c1514d..e6f389e43 100644 --- a/contracts/generated/store/SetLoweringAccessController.go +++ b/contracts/generated/store/SetLoweringAccessController.go @@ -18,7 +18,7 @@ type SetLoweringAccessController struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSetLoweringAccessControllerInstructionBuilder creates a new `SetLoweringAccessController` instruction builder. @@ -37,7 +37,7 @@ func (inst *SetLoweringAccessController) SetStoreAccount(store ag_solanago.Publi // GetStoreAccount gets the "store" account. func (inst *SetLoweringAccessController) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *SetLoweringAccessController) SetAuthorityAccount(authority ag_solana // GetAuthorityAccount gets the "authority" account. func (inst *SetLoweringAccessController) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *SetLoweringAccessController) SetAccessControllerAccount(accessContro // GetAccessControllerAccount gets the "accessController" account. func (inst *SetLoweringAccessController) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst SetLoweringAccessController) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *SetLoweringAccessController) EncodeToTree(parent ag_treeout.Branches // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/store/SetValidatorConfig.go b/contracts/generated/store/SetValidatorConfig.go index d3aa39c38..8dd28b3df 100644 --- a/contracts/generated/store/SetValidatorConfig.go +++ b/contracts/generated/store/SetValidatorConfig.go @@ -19,7 +19,7 @@ type SetValidatorConfig struct { // [1] = [] owner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSetValidatorConfigInstructionBuilder creates a new `SetValidatorConfig` instruction builder. @@ -44,7 +44,7 @@ func (inst *SetValidatorConfig) SetFeedAccount(feed ag_solanago.PublicKey) *SetV // GetFeedAccount gets the "feed" account. func (inst *SetValidatorConfig) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -55,7 +55,7 @@ func (inst *SetValidatorConfig) SetOwnerAccount(owner ag_solanago.PublicKey) *Se // GetOwnerAccount gets the "owner" account. func (inst *SetValidatorConfig) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -66,7 +66,7 @@ func (inst *SetValidatorConfig) SetAuthorityAccount(authority ag_solanago.Public // GetAuthorityAccount gets the "authority" account. func (inst *SetValidatorConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst SetValidatorConfig) Build() *Instruction { @@ -124,9 +124,9 @@ func (inst *SetValidatorConfig) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/store/SetWriter.go b/contracts/generated/store/SetWriter.go index 4e70a5437..008afbc90 100644 --- a/contracts/generated/store/SetWriter.go +++ b/contracts/generated/store/SetWriter.go @@ -19,7 +19,7 @@ type SetWriter struct { // [1] = [] owner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSetWriterInstructionBuilder creates a new `SetWriter` instruction builder. @@ -44,7 +44,7 @@ func (inst *SetWriter) SetFeedAccount(feed ag_solanago.PublicKey) *SetWriter { // GetFeedAccount gets the "feed" account. func (inst *SetWriter) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -55,7 +55,7 @@ func (inst *SetWriter) SetOwnerAccount(owner ag_solanago.PublicKey) *SetWriter { // GetOwnerAccount gets the "owner" account. func (inst *SetWriter) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -66,7 +66,7 @@ func (inst *SetWriter) SetAuthorityAccount(authority ag_solanago.PublicKey) *Set // GetAuthorityAccount gets the "authority" account. func (inst *SetWriter) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst SetWriter) Build() *Instruction { @@ -124,9 +124,9 @@ func (inst *SetWriter) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/store/Submit.go b/contracts/generated/store/Submit.go index 85a44e116..cb9d9feb8 100644 --- a/contracts/generated/store/Submit.go +++ b/contracts/generated/store/Submit.go @@ -17,7 +17,7 @@ type Submit struct { // [0] = [WRITE] feed // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewSubmitInstructionBuilder creates a new `Submit` instruction builder. @@ -42,7 +42,7 @@ func (inst *Submit) SetFeedAccount(feed ag_solanago.PublicKey) *Submit { // GetFeedAccount gets the "feed" account. func (inst *Submit) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *Submit) SetAuthorityAccount(authority ag_solanago.PublicKey) *Submit // GetAuthorityAccount gets the "authority" account. func (inst *Submit) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst Submit) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *Submit) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/store/TransferFeedOwnership.go b/contracts/generated/store/TransferFeedOwnership.go index e54eae85e..c939afefa 100644 --- a/contracts/generated/store/TransferFeedOwnership.go +++ b/contracts/generated/store/TransferFeedOwnership.go @@ -19,7 +19,7 @@ type TransferFeedOwnership struct { // [1] = [] owner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewTransferFeedOwnershipInstructionBuilder creates a new `TransferFeedOwnership` instruction builder. @@ -44,7 +44,7 @@ func (inst *TransferFeedOwnership) SetFeedAccount(feed ag_solanago.PublicKey) *T // GetFeedAccount gets the "feed" account. func (inst *TransferFeedOwnership) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetOwnerAccount sets the "owner" account. @@ -55,7 +55,7 @@ func (inst *TransferFeedOwnership) SetOwnerAccount(owner ag_solanago.PublicKey) // GetOwnerAccount gets the "owner" account. func (inst *TransferFeedOwnership) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } // SetAuthorityAccount sets the "authority" account. @@ -66,7 +66,7 @@ func (inst *TransferFeedOwnership) SetAuthorityAccount(authority ag_solanago.Pub // GetAuthorityAccount gets the "authority" account. func (inst *TransferFeedOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[2] + return inst.AccountMetaSlice.Get(2) } func (inst TransferFeedOwnership) Build() *Instruction { @@ -124,9 +124,9 @@ func (inst *TransferFeedOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) }) }) }) diff --git a/contracts/generated/store/TransferStoreOwnership.go b/contracts/generated/store/TransferStoreOwnership.go index b2d9bbcd0..2c7143dc4 100644 --- a/contracts/generated/store/TransferStoreOwnership.go +++ b/contracts/generated/store/TransferStoreOwnership.go @@ -17,7 +17,7 @@ type TransferStoreOwnership struct { // [0] = [WRITE] store // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` + ag_solanago.AccountMetaSlice `bin:"-"` } // NewTransferStoreOwnershipInstructionBuilder creates a new `TransferStoreOwnership` instruction builder. @@ -42,7 +42,7 @@ func (inst *TransferStoreOwnership) SetStoreAccount(store ag_solanago.PublicKey) // GetStoreAccount gets the "store" account. func (inst *TransferStoreOwnership) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[0] + return inst.AccountMetaSlice.Get(0) } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *TransferStoreOwnership) SetAuthorityAccount(authority ag_solanago.Pu // GetAuthorityAccount gets the "authority" account. func (inst *TransferStoreOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice[1] + return inst.AccountMetaSlice.Get(1) } func (inst TransferStoreOwnership) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *TransferStoreOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) }) }) }) diff --git a/contracts/generated/store/types.go b/contracts/generated/store/types.go index 84dc701f0..65ae77070 100644 --- a/contracts/generated/store/types.go +++ b/contracts/generated/store/types.go @@ -98,55 +98,55 @@ type Scope interface { type scopeContainer struct { Enum ag_binary.BorshEnum `borsh_enum:"true"` - Version Version - Decimals Decimals - Description Description - RoundData RoundData - LatestRoundData LatestRoundData - Aggregator Aggregator + Version ScopeVersion + Decimals ScopeDecimals + Description ScopeDescription + RoundData ScopeRoundData + LatestRoundData ScopeLatestRoundData + Aggregator ScopeAggregator } -type Version uint8 +type ScopeVersion uint8 -func (obj Version) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj ScopeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *Version) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *ScopeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *Version) isScope() {} +func (_ *ScopeVersion) isScope() {} -type Decimals uint8 +type ScopeDecimals uint8 -func (obj Decimals) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj ScopeDecimals) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *Decimals) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *ScopeDecimals) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *Decimals) isScope() {} +func (_ *ScopeDecimals) isScope() {} -type Description uint8 +type ScopeDescription uint8 -func (obj Description) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj ScopeDescription) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *Description) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *ScopeDescription) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *Description) isScope() {} +func (_ *ScopeDescription) isScope() {} -type RoundData struct { +type ScopeRoundData struct { RoundId uint32 } -func (obj RoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj ScopeRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { // Serialize `RoundId` param: err = encoder.Encode(obj.RoundId) if err != nil { @@ -155,7 +155,7 @@ func (obj RoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) return nil } -func (obj *RoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *ScopeRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { // Deserialize `RoundId`: err = decoder.Decode(&obj.RoundId) if err != nil { @@ -164,28 +164,28 @@ func (obj *RoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err erro return nil } -func (_ *RoundData) isScope() {} +func (_ *ScopeRoundData) isScope() {} -type LatestRoundData uint8 +type ScopeLatestRoundData uint8 -func (obj LatestRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj ScopeLatestRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *LatestRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *ScopeLatestRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *LatestRoundData) isScope() {} +func (_ *ScopeLatestRoundData) isScope() {} -type Aggregator uint8 +type ScopeAggregator uint8 -func (obj Aggregator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj ScopeAggregator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *Aggregator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *ScopeAggregator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *Aggregator) isScope() {} +func (_ *ScopeAggregator) isScope() {} From 7efc954e48d0da57e3fc366296a1cf9f3d41e5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 13:10:08 +0900 Subject: [PATCH 06/47] fix payees --- tests/e2e/solclient/ocr2.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/e2e/solclient/ocr2.go b/tests/e2e/solclient/ocr2.go index eee82adbe..767c8e1a8 100644 --- a/tests/e2e/solclient/ocr2.go +++ b/tests/e2e/solclient/ocr2.go @@ -351,11 +351,15 @@ func (m *OCRv2) proposeConfig(ocConfig contracts.OffChainAggregatorV2Config) err for i := 0; i < len(oracles); i++ { payees = append(payees, payee.PublicKey()) } - instr = append(instr, ocr_2.NewProposePayeesInstruction( + proposeInstr := ocr_2.NewProposePayeesInstruction( m.Mint.PublicKey(), m.Proposal.PublicKey(), - m.Owner.PublicKey()).Build(), - ) + m.Owner.PublicKey()) + // Add payees as remaining accounts + for i := 0; i < len(payees); i++ { + proposeInstr.Append(solana.Meta(payees[i])) + } + instr = append(instr, proposeInstr.Build()) // TODO: how to set payees as remaining return m.Client.TXSync( "Set payees", From c763bb71e3f0626700ef56a8056026423bddcc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 14:27:47 +0900 Subject: [PATCH 07/47] Allow setting historical ringbuffer size to 0 --- contracts/programs/store/src/lib.rs | 4 ++++ contracts/programs/store/src/state.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/contracts/programs/store/src/lib.rs b/contracts/programs/store/src/lib.rs index a3e6d61f1..f8719f5bd 100644 --- a/contracts/programs/store/src/lib.rs +++ b/contracts/programs/store/src/lib.rs @@ -70,6 +70,10 @@ pub mod store { // Live length must not exceed total capacity require!(live_length <= space as u32, InvalidInput); + // Both inputs should also be more than zero + require!(live_length > 0, InvalidInput); + require!(granularity > 0, InvalidInput); + feed.version = FEED_VERSION; feed.state = Transmissions::NORMAL; feed.owner = ctx.accounts.authority.key(); diff --git a/contracts/programs/store/src/state.rs b/contracts/programs/store/src/state.rs index c20430d58..c59c82166 100644 --- a/contracts/programs/store/src/state.rs +++ b/contracts/programs/store/src/state.rs @@ -111,6 +111,11 @@ impl<'a> Feed<'a> { self.live[self.header.live_cursor as usize] = round; self.header.live_cursor = (self.header.live_cursor + 1) % self.live.len() as u32; + // Skip if historical ringbuffer is disabled + if self.historical.len() == 0 { + return; + } + if self.header.latest_round_id % self.header.granularity as u32 == 0 { // insert into historical data self.historical[self.header.historical_cursor as usize] = round; From 429be21146c1901e7dec71f2f5eccaea956fdf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 14:28:53 +0900 Subject: [PATCH 08/47] Disallow fetching non-existent round 0 --- contracts/programs/store/src/state.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/programs/store/src/state.rs b/contracts/programs/store/src/state.rs index c59c82166..2b7106366 100644 --- a/contracts/programs/store/src/state.rs +++ b/contracts/programs/store/src/state.rs @@ -137,6 +137,10 @@ impl<'a> Feed<'a> { } pub fn fetch(&self, round_id: u32) -> Option { + if round_id == 0 { + return None; + } + if self.header.latest_round_id < round_id { return None; } From e7b4e5320bbc535db6d1c399544b6dc777693687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 14:31:23 +0900 Subject: [PATCH 09/47] fix: Off-by one check on offchain config setting We didn't allow filling the last byte of the config area. --- contracts/programs/ocr2/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index e12e99588..935a71999 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -110,7 +110,7 @@ pub mod ocr2 { require!(proposal.state != Proposal::FINALIZED, InvalidInput); require!( - offchain_config.len() < proposal.offchain_config.remaining_capacity(), + offchain_config.len() <= proposal.offchain_config.remaining_capacity(), InvalidInput ); proposal.offchain_config.extend(&offchain_config); From 61384cf56a8d10c8c4fb4d384f1a6c163e94ca21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 14:46:31 +0900 Subject: [PATCH 10/47] Allow unsetting proposed_owner --- contracts/programs/access-controller/src/lib.rs | 1 - contracts/programs/ocr2/src/lib.rs | 1 - contracts/programs/store/src/lib.rs | 2 -- 3 files changed, 4 deletions(-) diff --git a/contracts/programs/access-controller/src/lib.rs b/contracts/programs/access-controller/src/lib.rs index 2bda02d8c..ecc49493a 100644 --- a/contracts/programs/access-controller/src/lib.rs +++ b/contracts/programs/access-controller/src/lib.rs @@ -40,7 +40,6 @@ pub mod access_controller { ctx: Context, proposed_owner: Pubkey, ) -> Result<()> { - require!(proposed_owner != Pubkey::default(), InvalidInput); let state = &mut *ctx.accounts.state.load_mut()?; state.proposed_owner = proposed_owner; Ok(()) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 935a71999..422e1e1b6 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -71,7 +71,6 @@ pub mod ocr2 { ctx: Context, proposed_owner: Pubkey, ) -> Result<()> { - require!(proposed_owner != Pubkey::default(), InvalidInput); let mut state = ctx.accounts.state.load_mut()?; state.config.proposed_owner = proposed_owner; Ok(()) diff --git a/contracts/programs/store/src/lib.rs b/contracts/programs/store/src/lib.rs index f8719f5bd..7a2a8874b 100644 --- a/contracts/programs/store/src/lib.rs +++ b/contracts/programs/store/src/lib.rs @@ -100,7 +100,6 @@ pub mod store { ctx: Context, proposed_owner: Pubkey, ) -> Result<()> { - require!(proposed_owner != Pubkey::default(), InvalidInput); ctx.accounts.feed.proposed_owner = proposed_owner; Ok(()) } @@ -199,7 +198,6 @@ pub mod store { ctx: Context, proposed_owner: Pubkey, ) -> Result<()> { - require!(proposed_owner != Pubkey::default(), InvalidInput); let store = &mut *ctx.accounts.store.load_mut()?; store.proposed_owner = proposed_owner; Ok(()) From 30a9dc77d0abd4351194eea0b752d9a91cbeb13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 13:22:49 +0900 Subject: [PATCH 11/47] Fix a bunch of gauntlet compilation issues This should use a better solution that imports the actual IDL so code is properly typed, but `any` is a quick fix that matches the old untyped behaviour. --- .../gauntlet-serum-multisig/src/commands/multisig.ts | 8 ++++---- .../src/commands/abstract/upgrade.ts | 2 +- .../src/commands/contracts/accessController/read.ts | 2 +- .../src/commands/contracts/ocr2/close.ts | 2 +- .../src/commands/contracts/ocr2/fund.ts | 2 +- .../src/commands/contracts/ocr2/inspection/inspect.ts | 4 ++-- .../contracts/ocr2/inspection/inspectResponses.ts | 2 +- .../commands/contracts/ocr2/proposal/acceptProposal.ts | 6 +++--- .../src/commands/contracts/ocr2/proposeConfig.ts | 2 +- .../commands/contracts/ocr2/proposeOffchainConfig.ts | 2 +- .../src/commands/contracts/ocr2/proposePayees.ts | 10 +++++----- .../src/commands/contracts/ocr2/read.ts | 2 +- .../src/commands/contracts/ocr2/setBilling.ts | 2 +- .../contracts/ocr2/setBillingAccessController.ts | 2 +- .../contracts/ocr2/setRequesterAccessController.ts | 2 +- .../src/commands/contracts/ocr2/transmit.dev.ts | 4 ++-- .../src/commands/contracts/ocr2/withdrawFunds.ts | 2 +- .../src/commands/contracts/store/close.ts | 2 +- .../contracts/store/setLoweringAccessController.ts | 2 +- 19 files changed, 30 insertions(+), 30 deletions(-) diff --git a/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts b/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts index a454031c4..bd4dc2eed 100644 --- a/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts +++ b/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts @@ -79,7 +79,7 @@ export const wrapCommand = (command) => { const msigState = await this.fetchMultisigState(this.multisigAddress) const proposalState = await this.fetchProposalState(proposal, msigState) - await this.inspectProposalState(msigState, proposalState) + this.inspectProposalState(msigState, proposalState) return { responses: [ { @@ -194,7 +194,7 @@ export const wrapCommand = (command) => { fetchMultisigState = async (address: PublicKey): Promise => { try { - const state = await this.program.account.multisig.fetch(address) + const state = await this.program.account.multisig.fetch(address) as any return { threshold: new BN(state.threshold).toNumber(), owners: state.owners.map((owner) => new PublicKey(owner)), @@ -210,7 +210,7 @@ export const wrapCommand = (command) => { multisigState: MultisigState, ): Promise => { try { - const state = await this.program.account.transaction.fetch(proposal) + const state = await this.program.account.transaction.fetch(proposal) as any return { id: proposal, data: Buffer.from(state.data), @@ -244,7 +244,7 @@ export const wrapCommand = (command) => { const proposal = Keypair.generate() logger.loading(`Creating Multisig Proposal account at ${proposal.publicKey.toString()}...`) const txSize = 1300 // Space enough - const proposalInstruction = await SystemProgram.createAccount({ + const proposalInstruction = SystemProgram.createAccount({ fromPubkey: this.wallet.publicKey, newAccountPubkey: proposal.publicKey, space: txSize, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/upgrade.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/upgrade.ts index 9868842e6..1044dca99 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/upgrade.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/upgrade.ts @@ -65,7 +65,7 @@ export const makeUpgradeProgramCommand = (contractId: CONTRACT_LIST): SolanaCons const rawTx = await makeRawUpgradeTransaction(this.wallet.payer.publicKey, contractId, this.flags.buffer) await prompt(`Continue upgrading the ${contractId} program?`) logger.loading('Upgrading program...') - const txhash = await this.provider.send(utils.makeTx(rawTx), [this.wallet.payer]) + const txhash = await this.provider.sendAndConfirm(utils.makeTx(rawTx), [this.wallet.payer]) logger.success(`Program upgraded on tx ${txhash}`) return { responses: [ diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts index 75fa61e6d..831054499 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts @@ -19,7 +19,7 @@ export default class ReadState extends SolanaCommand { const state = new PublicKey(this.flags.state) // read could be abstract. account.accessController is just the name of the account that can be got form the camelcase(schema.accounts[x].name) - const data = await program.account.accessController.fetch(state) + const data = await program.account.accessController.fetch(state) as any console.log(` - Owner: ${new PublicKey(data.owner).toString()} diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts index 808c03866..75911338f 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts @@ -21,7 +21,7 @@ export default class extends Close { const program = this.loadProgram(contract.idl, contract.programId.toString()) const address = new PublicKey(this.args[0]) - const { config, oracles } = await program.account.state.fetch(address) + const { config, oracles } = await program.account.state.fetch(address) as any const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), address.toBuffer()], program.programId, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts index 542b2b897..780c4a3be 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts @@ -28,7 +28,7 @@ export default class Fund extends SolanaCommand { const linkPublicKey = new PublicKey(this.flags.link || process.env.LINK) // Resolve the tokenVault from the aggregator state account - const stateAccount = await program.account.state.fetch(state) + const stateAccount = await program.account.state.fetch(state) as any const tokenVault = stateAccount.config.tokenVault const tokenMint = stateAccount.config.tokenMint this.require(tokenMint.equals(linkPublicKey), 'LINK does not match aggregator.config.tokenMint') diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts index cd32a7592..04972d4c9 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts @@ -82,7 +82,7 @@ export default class OCR2Inspect extends SolanaCommand { makeFeedInspections = async (bufferedInfo: Keypair, input: Input): Promise => { const store = getContract(CONTRACT_LIST.STORE, '') const storeProgram = this.loadProgram(store.idl, store.programId.toString()) - const account = await storeProgram.account.description.fetch(bufferedInfo.publicKey) + const account = await storeProgram.account.description.fetch(bufferedInfo.publicKey) as any return [ inspection.makeInspection( // Description comes with some empty bytes @@ -142,7 +142,7 @@ export default class OCR2Inspect extends SolanaCommand { const ocr2program = this.loadProgram(ocr2.idl, ocr2.programId.toString()) const state = new PublicKey(this.args[0]) - const onChainState = await ocr2program.account.state.fetch(state) + const onChainState = await ocr2program.account.state.fetch(state) as any // Get balance const balance = await this.provider.connection.getBalance(state) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts index c6e7cefcb..5c1fc5d74 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts @@ -95,7 +95,7 @@ export default class OCR2InspectResponses extends SolanaCommand { const state = new PublicKey(this.args[0]) const input = this.makeInput(this.flags.input) - const onChainState = await program.account.state.fetch(state) + const onChainState = await program.account.state.fetch(state) as any logger.info( `Latest Config: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts index 51cc74e93..5dd21d099 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts @@ -111,7 +111,7 @@ export default class AcceptProposal extends SolanaCommand { makeContractInput = async (input: Input): Promise => { const state = new PublicKey(this.args[0]) - const contractState = await this.program.account.state.fetch(state) + const contractState = await this.program.account.state.fetch(state) as any const offchainDigest = this.calculateProposalDigest( await this.makeDigestInput(input, new PublicKey(contractState.config.tokenMint)), ) @@ -226,8 +226,8 @@ export default class AcceptProposal extends SolanaCommand { } beforeExecute = async () => { - const contractState = await this.program.account.state.fetch(new PublicKey(this.args[0])) - const proposalState = await this.program.account.proposal.fetch(new PublicKey(this.input.proposalId)) + const contractState = await this.program.account.state.fetch(new PublicKey(this.args[0])) as any + const proposalState = await this.program.account.proposal.fetch(new PublicKey(this.input.proposalId)) as any const [contractConfig, proposalConfig] = [contractState, proposalState].map((state) => { const oracles = state.oracles?.xs.slice(0, state.oracles.len.toNumber()) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts index 43723ccef..f70422df1 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts @@ -94,7 +94,7 @@ export default class ProposeConfig extends SolanaCommand { beforeExecute = async () => { const state = new PublicKey(this.args[0]) - const contractState = await this.program.account.state.fetch(state) + const contractState = await this.program.account.state.fetch(state) as any // Prepare contract config const contractOracles = contractState.oracles?.xs.slice(0, contractState.oracles.len.toNumber()) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts index 78ce4dcb9..34ffde151 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts @@ -257,7 +257,7 @@ export default class ProposeOffchainConfig extends SolanaCommand { beforeExecute = async () => { const state = new PublicKey(this.args[0]) - const contractState = await this.program.account.state.fetch(state) + const contractState = await this.program.account.state.fetch(state) as any // Config in contract const contractOffchainConfig = deserializeConfig( diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index 61ba38989..c8aebb2f1 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -80,8 +80,8 @@ export default class ProposePayees extends SolanaCommand { buildCommand = async (flags, args) => { const ocr2 = getContract(CONTRACT_LIST.OCR_2, '') this.program = this.loadProgram(ocr2.idl, ocr2.programId.toString()) - this.input = await this.makeInput(flags.input) - this.contractInput = await this.makeContractInput(this.input) + this.input = this.makeInput(flags.input) + this.contractInput = this.makeContractInput(this.input) return this } @@ -116,7 +116,7 @@ export default class ProposePayees extends SolanaCommand { // Set the payees in the same order the oracles are saved in the proposal // The length of the payees need to be same as the oracles saved const proposal = new PublicKey(this.input.proposalId) - const proposalInfo = await this.program.account.proposal.fetch(proposal) + const proposalInfo = await this.program.account.proposal.fetch(proposal) as any const payees = proposalInfo.oracles.xs .slice(0, proposalInfo.oracles.len) .map(({ transmitter }) => this.contractInput.payeeByTransmitter[transmitter.toString()]) @@ -134,8 +134,8 @@ export default class ProposePayees extends SolanaCommand { beforeExecute = async () => { const state = new PublicKey(this.args[0]) const proposal = new PublicKey(this.input.proposalId) - const contractState = await this.program.account.state.fetch(state) - const proposalState = await this.program.account.proposal.fetch(proposal) + const contractState = await this.program.account.state.fetch(state) as any + const proposalState = await this.program.account.proposal.fetch(proposal) as any const payeesInContract = { oracles: contractState.oracles.xs diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts index 351e9b93e..e9044dd51 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts @@ -31,7 +31,7 @@ export default class ReadState extends SolanaCommand { const state = new PublicKey(this.args[0]) // read could be abstract. account.accessController is just the name of the account that can be got form the camelcase(schema.accounts[x].name) - const data = await program.account.state.fetch(state) + const data = await program.account.state.fetch(state) as any console.log('OWNER:', new PublicKey(data.config.owner).toString()) console.log('DATA:', data) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts index 93c84be02..beca894f3 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts @@ -57,7 +57,7 @@ export default class SetBilling extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const state = new PublicKey(this.args[0]) - const info = await this.program.account.state.fetch(state) + const info = await this.program.account.state.fetch(state) as any const tokenVault = new PublicKey(info.config.tokenVault) const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), state.toBuffer()], diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts index 7fb209c48..32d89908f 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts @@ -26,7 +26,7 @@ export default class SetBillingAccessController extends SolanaCommand { const state = new PublicKey(this.args[0]) const ac = new PublicKey(this.flags.accessController) - const info = await program.account.state.fetch(state) + const info = await program.account.state.fetch(state) as any const oldAC = info.config.billingAccessController logger.log(`Access controller information: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts index f125b00ba..3450d92d6 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts @@ -26,7 +26,7 @@ export default class SetRequesterAccessController extends SolanaCommand { const state = new PublicKey(this.args[0]) const ac = new PublicKey(this.flags.accessController) - const info = await program.account.state.fetch(state) + const info = await program.account.state.fetch(state) as any const oldAC = info.config.requesterAccessController logger.log(`Access controller information: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts index 103d1f255..df0702296 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts @@ -31,7 +31,7 @@ export default class Transmit extends SolanaCommand { const transmissions = new PublicKey(this.flags.transmissions) const store = new PublicKey(this.flags.store) const round = Number(this.flags.round) || 1 - const info = await program.account.state.fetch(state) + const info = await program.account.state.fetch(state) as any const reportContext: any[] = [] reportContext.push(...info.config.latestConfigDigest) @@ -93,7 +93,7 @@ export default class Transmit extends SolanaCommand { let txhash try { - txhash = await this.provider.send(tx, [transmitter]) + txhash = await this.provider.sendAndConfirm(tx, [transmitter]) } catch (err) { // Translate IDL error const idlErrors = parseIdlErrors(program.idl) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts index 161360f0a..b9451822a 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts @@ -59,7 +59,7 @@ export default class WithdrawFunds extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const state = new PublicKey(this.args[0]) - const info = await this.program.account.state.fetch(state) + const info = await this.program.account.state.fetch(state) as any const tokenVault = new PublicKey(info.config.tokenVault) const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), state.toBuffer()], diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts index be12f41dd..54fc5d280 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts @@ -20,7 +20,7 @@ export default class CloseFeed extends Close { const program = this.loadProgram(contract.idl, contract.programId.toString()) const transmissions = new PublicKey(this.args[0]) - const info = await program.account.transmissions.fetch(transmissions) + const info = await program.account.transmissions.fetch(transmissions) as any const extraAccounts = { feed: transmissions, owner: new PublicKey(info.owner), diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts index b5a4fc546..9c7fbf5ae 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts @@ -26,7 +26,7 @@ export default class SetLoweringAccessController extends SolanaCommand { const state = new PublicKey(this.args[0]) const ac = new PublicKey(this.flags.accessController) - const info = await program.account.store.fetch(state) + const info = await program.account.store.fetch(state) as any const oldAC = info.loweringAccessController logger.log(`Access controller information: From d1b4da99cc168b50bbd00f31a986152e70e4cc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 13:31:56 +0900 Subject: [PATCH 12/47] Fix compilation issues that used the old anchor syntax --- .../src/commands/multisig.ts | 36 +++++++++---------- .../src/commands/setOwners.ts | 9 ++--- .../src/commands/setThreshold.ts | 9 ++--- .../src/commands/abstract/close.ts | 10 +++--- .../contracts/accessController/read.ts | 2 +- .../src/commands/contracts/ocr2/close.ts | 2 +- .../src/commands/contracts/ocr2/fund.ts | 2 +- .../src/commands/contracts/ocr2/initialize.ts | 9 ++--- .../contracts/ocr2/inspection/inspect.ts | 4 +-- .../ocr2/inspection/inspectResponses.ts | 2 +- .../contracts/ocr2/proposal/acceptProposal.ts | 17 ++++----- .../contracts/ocr2/proposal/createProposal.ts | 9 ++--- .../ocr2/proposal/finalizeProposal.ts | 9 ++--- .../commands/contracts/ocr2/proposeConfig.ts | 11 +++--- .../contracts/ocr2/proposeOffchainConfig.ts | 19 +++++----- .../commands/contracts/ocr2/proposePayees.ts | 18 +++++----- .../src/commands/contracts/ocr2/read.ts | 2 +- .../src/commands/contracts/ocr2/setBilling.ts | 29 +++++++-------- .../ocr2/setBillingAccessController.ts | 2 +- .../ocr2/setRequesterAccessController.ts | 2 +- .../commands/contracts/ocr2/transmit.dev.ts | 2 +- .../commands/contracts/ocr2/withdrawFunds.ts | 11 +++--- .../contracts/ownership/acceptOwnership.ts | 9 ++--- .../contracts/ownership/transferOwnership.ts | 9 ++--- .../contracts/store/acceptFeedOwnership.ts | 11 +++--- .../contracts/store/acceptStoreOwnership.ts | 9 ++--- .../src/commands/contracts/store/close.ts | 2 +- .../commands/contracts/store/createFeed.ts | 9 ++--- .../store/setLoweringAccessController.ts | 2 +- .../contracts/store/setValidatorConfig.ts | 11 +++--- .../src/commands/contracts/store/setWriter.ts | 11 +++--- .../contracts/store/transferFeedOwnership.ts | 11 +++--- .../contracts/store/transferStoreOwnership.ts | 9 ++--- 33 files changed, 164 insertions(+), 145 deletions(-) diff --git a/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts b/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts index bd4dc2eed..f765fd671 100644 --- a/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts +++ b/gauntlet/packages/gauntlet-serum-multisig/src/commands/multisig.ts @@ -194,7 +194,7 @@ export const wrapCommand = (command) => { fetchMultisigState = async (address: PublicKey): Promise => { try { - const state = await this.program.account.multisig.fetch(address) as any + const state = (await this.program.account.multisig.fetch(address)) as any return { threshold: new BN(state.threshold).toNumber(), owners: state.owners.map((owner) => new PublicKey(owner)), @@ -210,7 +210,7 @@ export const wrapCommand = (command) => { multisigState: MultisigState, ): Promise => { try { - const state = await this.program.account.transaction.fetch(proposal) as any + const state = (await this.program.account.transaction.fetch(proposal)) as any return { id: proposal, data: Buffer.from(state.data), @@ -263,31 +263,30 @@ export const wrapCommand = (command) => { ): Promise => { logger.loading(`Generating Multisig Proposal CREATION data for ${command.id}`) - const tx = this.program.instruction.createTransaction( - context.rawTx.programId, - context.rawTx.keys, - context.rawTx.data, - { + const tx = await this.program.methods + .createTransaction(context.rawTx.programId, context.rawTx.keys, context.rawTx.data) + .accounts({ accounts: { multisig: this.multisigAddress, transaction: proposal, proposer: signer, }, - }, - ) + }) + .instruction() return [tx] } approveProposal: ProposalAction = async (proposal: PublicKey, signer): Promise => { logger.loading(`Generating Multisig Proposal APPROVAL data for ${command.id}`) - const tx = this.program.instruction.approve({ - accounts: { + const tx = await this.program.methods + .approve() + .accounts({ multisig: this.multisigAddress, transaction: proposal, owner: signer, - }, - }) + }) + .instruction() return [tx] } @@ -306,14 +305,15 @@ export const wrapCommand = (command) => { isSigner: false, }) - const tx = this.program.instruction.executeTransaction({ - accounts: { + const tx = await this.program.methods + .executeTransaction() + .accounts({ multisig: this.multisigAddress, transaction: proposal, multisigSigner: context.multisigSigner, - }, - remainingAccounts, - }) + }) + .remainingAccounts(remainingAccounts) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-serum-multisig/src/commands/setOwners.ts b/gauntlet/packages/gauntlet-serum-multisig/src/commands/setOwners.ts index 88da41362..f942b2898 100644 --- a/gauntlet/packages/gauntlet-serum-multisig/src/commands/setOwners.ts +++ b/gauntlet/packages/gauntlet-serum-multisig/src/commands/setOwners.ts @@ -23,12 +23,13 @@ export default class SetOwners extends SolanaCommand { logger.info(`Generating data for new owners: ${owners.map((o) => o.toString())}`) - const ix = program.instruction.setOwners(owners, { - accounts: { + const ix = await program.methods + .setOwners(owners) + .accounts({ multisig: multisigAddress, multisigSigner: signer, - }, - }) + }) + .instruction() return [ix] } diff --git a/gauntlet/packages/gauntlet-serum-multisig/src/commands/setThreshold.ts b/gauntlet/packages/gauntlet-serum-multisig/src/commands/setThreshold.ts index e06d12380..477d0fabf 100644 --- a/gauntlet/packages/gauntlet-serum-multisig/src/commands/setThreshold.ts +++ b/gauntlet/packages/gauntlet-serum-multisig/src/commands/setThreshold.ts @@ -24,12 +24,13 @@ export default class SetThreshold extends SolanaCommand { const threshold = new BN(this.flags.threshold) logger.info(`Generating data for new threshold: ${threshold.toNumber()}`) - const ix = program.instruction.changeThreshold(threshold, { - accounts: { + const ix = await program.methods + .changeThreshold(threshold) + .accounts({ multisig: multisigAddress, multisigSigner: signer, - }, - }) + }) + .instruction() return [ix] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/close.ts index 5d4cbaa58..d2ae75cd1 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/abstract/close.ts @@ -35,14 +35,14 @@ export default abstract class Close extends SolanaCommand { `Preparing instruction to close account from ${this.contractId} contract with address ${state.toString()}`, ) - const ix = program.instruction[closeFunction]({ - accounts: { + const ix = await program.methods[closeFunction]() + .accounts({ receiver: signer, authority: signer, ...extraAccounts, - }, - remainingAccounts, - }) + }) + .remainingAccounts(remainingAccounts) + .instruction() return [ix] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts index 831054499..773709d1e 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/accessController/read.ts @@ -19,7 +19,7 @@ export default class ReadState extends SolanaCommand { const state = new PublicKey(this.flags.state) // read could be abstract. account.accessController is just the name of the account that can be got form the camelcase(schema.accounts[x].name) - const data = await program.account.accessController.fetch(state) as any + const data = (await program.account.accessController.fetch(state)) as any console.log(` - Owner: ${new PublicKey(data.owner).toString()} diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts index 75911338f..f02635def 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts @@ -21,7 +21,7 @@ export default class extends Close { const program = this.loadProgram(contract.idl, contract.programId.toString()) const address = new PublicKey(this.args[0]) - const { config, oracles } = await program.account.state.fetch(address) as any + const { config, oracles } = (await program.account.state.fetch(address)) as any const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), address.toBuffer()], program.programId, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts index 780c4a3be..7d541c67d 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts @@ -28,7 +28,7 @@ export default class Fund extends SolanaCommand { const linkPublicKey = new PublicKey(this.flags.link || process.env.LINK) // Resolve the tokenVault from the aggregator state account - const stateAccount = await program.account.state.fetch(state) as any + const stateAccount = (await program.account.state.fetch(state)) as any const tokenVault = stateAccount.config.tokenVault const tokenMint = stateAccount.config.tokenMint this.require(tokenMint.equals(linkPublicKey), 'LINK does not match aggregator.config.tokenMint') diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index a601dc0ae..660d2f60a 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -72,8 +72,9 @@ export default class Initialize extends SolanaCommand { true, ) - const tx = program.instruction.initialize(minAnswer, maxAnswer, { - accounts: { + const tx = await program.methods + .initialize(minAnswer, maxAnswer) + .accounts({ state, feed: transmissions, payer: signer, @@ -87,8 +88,8 @@ export default class Initialize extends SolanaCommand { systemProgram: SystemProgram.programId, tokenProgram: TOKEN_PROGRAM_ID, associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, - }, - }) + }) + .instruction() console.log(` STATE ACCOUNTS: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts index 04972d4c9..3ba82c1dd 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspect.ts @@ -82,7 +82,7 @@ export default class OCR2Inspect extends SolanaCommand { makeFeedInspections = async (bufferedInfo: Keypair, input: Input): Promise => { const store = getContract(CONTRACT_LIST.STORE, '') const storeProgram = this.loadProgram(store.idl, store.programId.toString()) - const account = await storeProgram.account.description.fetch(bufferedInfo.publicKey) as any + const account = (await storeProgram.account.description.fetch(bufferedInfo.publicKey)) as any return [ inspection.makeInspection( // Description comes with some empty bytes @@ -142,7 +142,7 @@ export default class OCR2Inspect extends SolanaCommand { const ocr2program = this.loadProgram(ocr2.idl, ocr2.programId.toString()) const state = new PublicKey(this.args[0]) - const onChainState = await ocr2program.account.state.fetch(state) as any + const onChainState = (await ocr2program.account.state.fetch(state)) as any // Get balance const balance = await this.provider.connection.getBalance(state) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts index 5c1fc5d74..096965bae 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/inspection/inspectResponses.ts @@ -95,7 +95,7 @@ export default class OCR2InspectResponses extends SolanaCommand { const state = new PublicKey(this.args[0]) const input = this.makeInput(this.flags.input) - const onChainState = await program.account.state.fetch(state) as any + const onChainState = (await program.account.state.fetch(state)) as any logger.info( `Latest Config: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts index 5dd21d099..5e92d9726 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts @@ -111,7 +111,7 @@ export default class AcceptProposal extends SolanaCommand { makeContractInput = async (input: Input): Promise => { const state = new PublicKey(this.args[0]) - const contractState = await this.program.account.state.fetch(state) as any + const contractState = (await this.program.account.state.fetch(state)) as any const offchainDigest = this.calculateProposalDigest( await this.makeDigestInput(input, new PublicKey(contractState.config.tokenMint)), ) @@ -209,8 +209,9 @@ export default class AcceptProposal extends SolanaCommand { } makeRawTransaction = async (signer: PublicKey) => { - const tx = this.program.instruction.acceptProposal(this.contractInput.offchainDigest, { - accounts: { + const tx = await this.program.methods + .acceptProposal(this.contractInput.offchainDigest) + .accounts({ state: new PublicKey(this.args[0]), proposal: new PublicKey(this.input.proposalId), receiver: signer, @@ -218,16 +219,16 @@ export default class AcceptProposal extends SolanaCommand { tokenVault: this.contractInput.tokenVault, vaultAuthority: this.contractInput.vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, - }, - remainingAccounts: this.contractInput.payees, - }) + }) + .remainingAccounts(this.contractInput.payees) + .instruction() return [tx] } beforeExecute = async () => { - const contractState = await this.program.account.state.fetch(new PublicKey(this.args[0])) as any - const proposalState = await this.program.account.proposal.fetch(new PublicKey(this.input.proposalId)) as any + const contractState = (await this.program.account.state.fetch(new PublicKey(this.args[0]))) as any + const proposalState = (await this.program.account.proposal.fetch(new PublicKey(this.input.proposalId))) as any const [contractConfig, proposalConfig] = [contractState, proposalState].map((state) => { const oracles = state.oracles?.xs.slice(0, state.oracles.len.toNumber()) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/createProposal.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/createProposal.ts index 310a854ba..c217c50a6 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/createProposal.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/createProposal.ts @@ -26,12 +26,13 @@ export default class CreateProposal extends SolanaCommand { logger.log('Generating data for creating config proposal') logger.log('Config Proposal state will be at:', proposal.toString()) - const createIx = await program.instruction.createProposal(version, { - accounts: { + const createIx = await program.methods + .createProposal(version) + .accounts({ proposal: proposal, authority: signer, - }, - }) + }) + .instruction() const defaultAccountSize = new BN(program.account.proposal.size) const createAccountIx = SystemProgram.createAccount({ fromPubkey: signer, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/finalizeProposal.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/finalizeProposal.ts index f37f82b30..cc446961e 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/finalizeProposal.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/finalizeProposal.ts @@ -25,12 +25,13 @@ export default class FinalizeProposal extends SolanaCommand { const proposalId = this.flags.proposalId || this.flags.configProposal const proposal = new PublicKey(proposalId) - const finalizeIx = program.instruction.finalizeProposal({ - accounts: { + const finalizeIx = await program.methods + .finalizeProposal() + .accounts({ proposal: proposal, authority: signer, - }, - }) + }) + .instruction() return [finalizeIx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts index f70422df1..a73d54148 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts @@ -82,19 +82,20 @@ export default class ProposeConfig extends SolanaCommand { `Oracles max length is ${ORACLES_MAX_LENGTH}, currently ${oracles.length}`, ) - const ix = this.program.instruction.proposeConfig(oracles, f, { - accounts: { + const ix = await this.program.methods + .proposeConfig(oracles, f) + .accounts({ proposal, authority: signer, - }, - }) + }) + .instruction() return [ix] } beforeExecute = async () => { const state = new PublicKey(this.args[0]) - const contractState = await this.program.account.state.fetch(state) as any + const contractState = (await this.program.account.state.fetch(state)) as any // Prepare contract config const contractOracles = contractState.oracles?.xs.slice(0, contractState.oracles.len.toNumber()) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts index 34ffde151..cc0e5afd0 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts @@ -234,13 +234,16 @@ export default class ProposeOffchainConfig extends SolanaCommand { ) } - const ixs = offchainConfigChunks.map((buffer) => - this.program.instruction.writeOffchainConfig(buffer, { - accounts: { - proposal: proposal, - authority: signer, - }, - }), + const ixs = await Promise.all( + offchainConfigChunks.map((buffer) => + this.program.methods + .writeOffchainConfig(buffer) + .accounts({ + proposal: proposal, + authority: signer, + }) + .instruction(), + ), ) return ixs @@ -257,7 +260,7 @@ export default class ProposeOffchainConfig extends SolanaCommand { beforeExecute = async () => { const state = new PublicKey(this.args[0]) - const contractState = await this.program.account.state.fetch(state) as any + const contractState = (await this.program.account.state.fetch(state)) as any // Config in contract const contractOffchainConfig = deserializeConfig( diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index c8aebb2f1..84e48e199 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -116,26 +116,28 @@ export default class ProposePayees extends SolanaCommand { // Set the payees in the same order the oracles are saved in the proposal // The length of the payees need to be same as the oracles saved const proposal = new PublicKey(this.input.proposalId) - const proposalInfo = await this.program.account.proposal.fetch(proposal) as any + const proposalInfo = (await this.program.account.proposal.fetch(proposal)) as any const payees = proposalInfo.oracles.xs .slice(0, proposalInfo.oracles.len) .map(({ transmitter }) => this.contractInput.payeeByTransmitter[transmitter.toString()]) - const ix = this.program.instruction.proposePayees(token.publicKey, { - accounts: { + const ix = await this.program.methods + .proposePayees(token.publicKey) + .accounts({ proposal, authority: signer, - }, - remainingAccounts: payees, - }) + }) + .remainingAccounts(payees) + .instruction() + return [ix] } beforeExecute = async () => { const state = new PublicKey(this.args[0]) const proposal = new PublicKey(this.input.proposalId) - const contractState = await this.program.account.state.fetch(state) as any - const proposalState = await this.program.account.proposal.fetch(proposal) as any + const contractState = (await this.program.account.state.fetch(state)) as any + const proposalState = (await this.program.account.proposal.fetch(proposal)) as any const payeesInContract = { oracles: contractState.oracles.xs diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts index e9044dd51..a40b7bf0e 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/read.ts @@ -31,7 +31,7 @@ export default class ReadState extends SolanaCommand { const state = new PublicKey(this.args[0]) // read could be abstract. account.accessController is just the name of the account that can be got form the camelcase(schema.accounts[x].name) - const data = await program.account.state.fetch(state) as any + const data = (await program.account.state.fetch(state)) as any console.log('OWNER:', new PublicKey(data.config.owner).toString()) console.log('DATA:', data) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts index beca894f3..40be04f46 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts @@ -57,7 +57,7 @@ export default class SetBilling extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const state = new PublicKey(this.args[0]) - const info = await this.program.account.state.fetch(state) as any + const info = (await this.program.account.state.fetch(state)) as any const tokenVault = new PublicKey(info.config.tokenVault) const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), state.toBuffer()], @@ -68,21 +68,18 @@ export default class SetBilling extends SolanaCommand { .map((oracle) => ({ pubkey: oracle.payee, isWritable: true, isSigner: false })) const billingAC = new PublicKey(info.config.billingAccessController) - const data = this.program.instruction.setBilling( - new BN(this.input.observationPaymentGjuels), - new BN(this.input.transmissionPaymentGjuels), - { - accounts: { - state, - authority: signer, - accessController: billingAC, - tokenVault: tokenVault, - vaultAuthority: vaultAuthority, - tokenProgram: TOKEN_PROGRAM_ID, - }, - remainingAccounts: payees, - }, - ) + const data = await this.program.methods + .setBilling(new BN(this.input.observationPaymentGjuels), new BN(this.input.transmissionPaymentGjuels)) + .accounts({ + state, + authority: signer, + accessController: billingAC, + tokenVault: tokenVault, + vaultAuthority: vaultAuthority, + tokenProgram: TOKEN_PROGRAM_ID, + }) + .remainingAccounts(payees) + .instruction() return [data] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts index 32d89908f..4efda01af 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBillingAccessController.ts @@ -26,7 +26,7 @@ export default class SetBillingAccessController extends SolanaCommand { const state = new PublicKey(this.args[0]) const ac = new PublicKey(this.flags.accessController) - const info = await program.account.state.fetch(state) as any + const info = (await program.account.state.fetch(state)) as any const oldAC = info.config.billingAccessController logger.log(`Access controller information: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts index 3450d92d6..67cbdaf17 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setRequesterAccessController.ts @@ -26,7 +26,7 @@ export default class SetRequesterAccessController extends SolanaCommand { const state = new PublicKey(this.args[0]) const ac = new PublicKey(this.flags.accessController) - const info = await program.account.state.fetch(state) as any + const info = (await program.account.state.fetch(state)) as any const oldAC = info.config.requesterAccessController logger.log(`Access controller information: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts index df0702296..e298b6f66 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/transmit.dev.ts @@ -31,7 +31,7 @@ export default class Transmit extends SolanaCommand { const transmissions = new PublicKey(this.flags.transmissions) const store = new PublicKey(this.flags.store) const round = Number(this.flags.round) || 1 - const info = await program.account.state.fetch(state) as any + const info = (await program.account.state.fetch(state)) as any const reportContext: any[] = [] reportContext.push(...info.config.latestConfigDigest) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts index b9451822a..4dfb16082 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/withdrawFunds.ts @@ -59,7 +59,7 @@ export default class WithdrawFunds extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const state = new PublicKey(this.args[0]) - const info = await this.program.account.state.fetch(state) as any + const info = (await this.program.account.state.fetch(state)) as any const tokenVault = new PublicKey(info.config.tokenVault) const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), state.toBuffer()], @@ -68,8 +68,9 @@ export default class WithdrawFunds extends SolanaCommand { const billingAC = new PublicKey(info.config.billingAccessController) - const data = this.program.instruction.withdrawFunds(new BN(this.input.amountGjuels), { - accounts: { + const data = await this.program.methods + .withdrawFunds(new BN(this.input.amountGjuels)) + .accounts({ state, authority: signer, accessController: billingAC, @@ -77,8 +78,8 @@ export default class WithdrawFunds extends SolanaCommand { vaultAuthority: vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, recipient: this.input.recipient, - }, - }) + }) + .instruction() return [data] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/acceptOwnership.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/acceptOwnership.ts index 4d3716ca6..a07531b17 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/acceptOwnership.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/acceptOwnership.ts @@ -38,12 +38,13 @@ export const makeAcceptOwnershipCommand = ( const state = new PublicKey(this.args[0]) - const tx = program.instruction.acceptOwnership({ - accounts: { + const tx = await program.methods + .acceptOwnership() + .accounts({ state: state, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/transferOwnership.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/transferOwnership.ts index 299ad947a..4405bbfbf 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/transferOwnership.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ownership/transferOwnership.ts @@ -39,12 +39,13 @@ export const makeTransferOwnershipCommand = ( const state = new PublicKey(this.args[0]) const proposedOwner = new PublicKey(this.flags.to) - const tx = this.program.instruction.transferOwnership(proposedOwner, { - accounts: { + const tx = await this.program.methods + .transferOwnership(proposedOwner) + .accounts({ state: state, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptFeedOwnership.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptFeedOwnership.ts index 9d659a787..cef7c8627 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptFeedOwnership.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptFeedOwnership.ts @@ -25,15 +25,16 @@ export default class AcceptFeedOwnership extends SolanaCommand { // Need to resolve feed.proposedOwner. This will either match signer // store with store.owner == signer. If not, the instruction will error - const feedAccount = await program.account.transmissions.fetch(state) + const feedAccount = (await program.account.transmissions.fetch(state)) as any - const tx = program.instruction.acceptFeedOwnership({ - accounts: { + const tx = await program.methods + .acceptFeedOwnership() + .accounts({ feed: state, proposedOwner: feedAccount.proposedOwner, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptStoreOwnership.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptStoreOwnership.ts index 6f17543d0..0e6267150 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptStoreOwnership.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/acceptStoreOwnership.ts @@ -24,12 +24,13 @@ export default class AcceptStoreOwnership extends SolanaCommand { const state = new PublicKey(this.args[0]) - const tx = program.instruction.acceptStoreOwnership({ - accounts: { + const tx = await program.methods + .acceptStoreOwnership() + .accounts({ store: state, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts index 54fc5d280..3a8448b85 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/close.ts @@ -20,7 +20,7 @@ export default class CloseFeed extends Close { const program = this.loadProgram(contract.idl, contract.programId.toString()) const transmissions = new PublicKey(this.args[0]) - const info = await program.account.transmissions.fetch(transmissions) as any + const info = (await program.account.transmissions.fetch(transmissions)) as any const extraAccounts = { feed: transmissions, owner: new PublicKey(info.owner), diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts index 9c41bd842..1ce91b915 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts @@ -73,12 +73,13 @@ export default class CreateFeed extends SolanaCommand { programId: program.programId, }) - const ix = program.instruction.createFeed(description, decimals, granularity, liveLength, { - accounts: { + const ix = await program.methods + .createFeed(description, decimals, granularity, liveLength) + .accounts({ feed, authority: signer, - }, - }) + }) + .instruction() return [transmissionsCreationInstruction, ix] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts index 9c7fbf5ae..c0a595939 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setLoweringAccessController.ts @@ -26,7 +26,7 @@ export default class SetLoweringAccessController extends SolanaCommand { const state = new PublicKey(this.args[0]) const ac = new PublicKey(this.flags.accessController) - const info = await program.account.store.fetch(state) as any + const info = (await program.account.store.fetch(state)) as any const oldAC = info.loweringAccessController logger.log(`Access controller information: diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setValidatorConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setValidatorConfig.ts index e2fd6a5d6..e58b1fecf 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setValidatorConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setValidatorConfig.ts @@ -42,15 +42,16 @@ export default class SetValidatorConfig extends SolanaCommand { const feed = new PublicKey(input.feed) // Resolve the current store owner - let feedAccount = await program.account.transmissions.fetch(feed) + let feedAccount = (await program.account.transmissions.fetch(feed)) as any - const tx = program.instruction.setValidatorConfig(threshold, { - accounts: { + const tx = await program.methods + .setValidatorConfig(threshold) + .accounts({ feed: feed, owner: feedAccount.owner, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setWriter.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setWriter.ts index fb46bdcbd..b050516d5 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setWriter.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/setWriter.ts @@ -52,15 +52,16 @@ export default class SetWriter extends SolanaCommand { ) // Resolve the current store owner - let feedAccount = await storeProgram.account.transmissions.fetch(feedState) + let feedAccount = (await storeProgram.account.transmissions.fetch(feedState)) as any - const tx = storeProgram.instruction.setWriter(storeAuthority, { - accounts: { + const tx = await storeProgram.methods + .setWriter(storeAuthority) + .accounts({ feed: feedState, owner: feedAccount.owner, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferFeedOwnership.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferFeedOwnership.ts index 0daecad85..47402b0d5 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferFeedOwnership.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferFeedOwnership.ts @@ -26,15 +26,16 @@ export default class TransferFeedOwnership extends SolanaCommand { const proposedOwner = new PublicKey(this.flags.to) // Need to resolve feed.owner - const feedAccount = await program.account.transmissions.fetch(state) + const feedAccount = (await program.account.transmissions.fetch(state)) as any - const tx = program.instruction.transferFeedOwnership(proposedOwner, { - accounts: { + const tx = await program.methods + .transferFeedOwnership(proposedOwner) + .accounts({ feed: state, owner: feedAccount.owner, authority: signer, - }, - }) + }) + .instruction() return [tx] } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferStoreOwnership.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferStoreOwnership.ts index d43dd3a0f..9cb649c48 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferStoreOwnership.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/transferStoreOwnership.ts @@ -28,12 +28,13 @@ export default class TransferStoreOwnership extends SolanaCommand { const state = new PublicKey(this.args[0]) const proposedOwner = new PublicKey(this.flags.to) - const tx = program.instruction.transferStoreOwnership(proposedOwner, { - accounts: { + const tx = await program.methods + .transferStoreOwnership(proposedOwner) + .accounts({ store: state, authority: signer, - }, - }) + }) + .instruction() return [tx] } From 9518206cbde66fc6d5671de5ba1b433ccc27e624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 13:48:54 +0900 Subject: [PATCH 13/47] Provider -> AnchorProvider --- contracts/examples/hello-world/client.js | 2 +- contracts/examples/hello-world/tests/hello-world.ts | 2 +- contracts/migrate/deploy.js | 2 +- contracts/tests/ocr2.spec.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/examples/hello-world/client.js b/contracts/examples/hello-world/client.js index 83cb43447..2ed746e85 100644 --- a/contracts/examples/hello-world/client.js +++ b/contracts/examples/hello-world/client.js @@ -5,7 +5,7 @@ const CHAINLINK_PROGRAM_ID = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"; // USDT/USD const CHAINLINK_FEED = "CwBg8pxL73LvuJ781cWBGF1e64G2z7AbZ22J2g8Lp35a"; -const provider = anchor.Provider.env(); +const provider = anchor.AnchorProvider.env(); // Configure the cluster. anchor.setProvider(provider); diff --git a/contracts/examples/hello-world/tests/hello-world.ts b/contracts/examples/hello-world/tests/hello-world.ts index 8ab8efccc..9ab7919bb 100644 --- a/contracts/examples/hello-world/tests/hello-world.ts +++ b/contracts/examples/hello-world/tests/hello-world.ts @@ -6,7 +6,7 @@ import { HelloWorld } from '../target/types/hello_world'; const CHAINLINK_PROGRAM_ID = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"; describe('hello-world', () => { - const provider = anchor.Provider.env(); + const provider = anchor.AnchorProvider.env(); // Configure the client to use the local cluster. anchor.setProvider(provider); diff --git a/contracts/migrate/deploy.js b/contracts/migrate/deploy.js index 501b4567b..ae676c998 100644 --- a/contracts/migrate/deploy.js +++ b/contracts/migrate/deploy.js @@ -12,7 +12,7 @@ const UPGRADEABLE_BPF_LOADER_PROGRAM_ID = new anchor.web3.PublicKey( "BPFLoaderUpgradeab1e11111111111111111111111" ); -const provider = anchor.Provider.env(); +const provider = anchor.AnchorProvider.env(); // Configure the cluster. anchor.setProvider(provider); diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index c33d47573..b31b3814e 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -47,7 +47,7 @@ class Round extends Assignable {} describe("ocr2", async () => { // Configure the client to use the local cluster. - const provider = anchor.Provider.env(); + const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const billingAccessController = Keypair.generate(); From aeee924a852d7ef5b9b95f864dab91b511f4b34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 13:49:49 +0900 Subject: [PATCH 14/47] test compilation --- contracts/tests/ocr2.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index b31b3814e..69923007a 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -223,7 +223,7 @@ describe("ocr2", async () => { ); try { - return await provider.send(tx, [transmitter]); + return await provider.sendAndConfirm(tx, [transmitter]); } catch (err) { // Translate IDL error const idlErrors = anchor.parseIdlErrors(program.idl); @@ -582,7 +582,7 @@ describe("ocr2", async () => { // fetch payees account = await program.account.state.fetch(state.publicKey); let currentOracles = account.oracles.xs.slice(0, account.oracles.len); - let payees = currentOracles.map((oracle) => { + payees = currentOracles.map((oracle) => { return { pubkey: oracle.payee, isWritable: true, isSigner: false }; }); From 81cdcc802250267f46cec4828d3b7f780265f2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 14:11:51 +0900 Subject: [PATCH 15/47] yarn format --- contracts/crates/chainlink-solana/README.md | 2 +- contracts/examples/hello-world/client.js | 4 +- .../examples/hello-world/migrations/deploy.ts | 2 +- contracts/examples/hello-world/package.json | 20 +- .../examples/hello-world/tests/hello-world.ts | 79 +++---- contracts/package.json | 45 ++-- contracts/tests/ocr2.spec.ts | 222 ++++++++++-------- 7 files changed, 194 insertions(+), 180 deletions(-) diff --git a/contracts/crates/chainlink-solana/README.md b/contracts/crates/chainlink-solana/README.md index 14ed90beb..cb76f6531 100644 --- a/contracts/crates/chainlink-solana/README.md +++ b/contracts/crates/chainlink-solana/README.md @@ -1,3 +1,3 @@ # chainlink-solana -Chainlink client for Solana. \ No newline at end of file +Chainlink client for Solana. diff --git a/contracts/examples/hello-world/client.js b/contracts/examples/hello-world/client.js index 2ed746e85..ac9b224c7 100644 --- a/contracts/examples/hello-world/client.js +++ b/contracts/examples/hello-world/client.js @@ -27,7 +27,7 @@ async function main() { let tx = await program.rpc.execute({ accounts: { chainlinkFeed: CHAINLINK_FEED, - chainlinkProgram: CHAINLINK_PROGRAM_ID + chainlinkProgram: CHAINLINK_PROGRAM_ID, }, options: { commitment: "confirmed" }, }); @@ -39,4 +39,4 @@ async function main() { } console.log("Running client..."); -main().then(() => console.log("Success")); \ No newline at end of file +main().then(() => console.log("Success")); diff --git a/contracts/examples/hello-world/migrations/deploy.ts b/contracts/examples/hello-world/migrations/deploy.ts index 325cf3d0e..5e3df0dc3 100644 --- a/contracts/examples/hello-world/migrations/deploy.ts +++ b/contracts/examples/hello-world/migrations/deploy.ts @@ -9,4 +9,4 @@ module.exports = async function (provider) { anchor.setProvider(provider); // Add your deploy script here. -} +}; diff --git a/contracts/examples/hello-world/package.json b/contracts/examples/hello-world/package.json index caf95efe0..c9b1dd37f 100644 --- a/contracts/examples/hello-world/package.json +++ b/contracts/examples/hello-world/package.json @@ -1,12 +1,12 @@ { - "dependencies": { - "@project-serum/anchor": "^0.25.0" - }, - "devDependencies": { - "chai": "^4.3.4", - "mocha": "^9.0.3", - "ts-mocha": "^8.0.0", - "@types/mocha": "^9.0.0", - "typescript": "^4.3.5" - } + "dependencies": { + "@project-serum/anchor": "^0.25.0" + }, + "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/contracts/examples/hello-world/tests/hello-world.ts b/contracts/examples/hello-world/tests/hello-world.ts index 9ab7919bb..6f8a84458 100644 --- a/contracts/examples/hello-world/tests/hello-world.ts +++ b/contracts/examples/hello-world/tests/hello-world.ts @@ -1,11 +1,11 @@ -import * as anchor from '@project-serum/anchor'; -import * as fs from 'fs'; -import { Program, BN } from '@project-serum/anchor'; -import { HelloWorld } from '../target/types/hello_world'; +import * as anchor from "@project-serum/anchor"; +import * as fs from "fs"; +import { Program, BN } from "@project-serum/anchor"; +import { HelloWorld } from "../target/types/hello_world"; const CHAINLINK_PROGRAM_ID = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"; -describe('hello-world', () => { +describe("hello-world", () => { const provider = anchor.AnchorProvider.env(); // Configure the client to use the local cluster. @@ -13,13 +13,13 @@ describe('hello-world', () => { const program = anchor.workspace.HelloWorld as Program; - it('Is initialized!', async () => { + it("Is initialized!", async () => { const owner = provider.wallet; const store = anchor.web3.Keypair.generate(); const feed = anchor.web3.Keypair.generate(); const accessController = anchor.web3.Keypair.generate(); - let storeIdl = JSON.parse(fs.readFileSync('../../target/idl/store.json')); + let storeIdl = JSON.parse(fs.readFileSync("../../target/idl/store.json")); const storeProgram = new Program(storeIdl, CHAINLINK_PROGRAM_ID, provider); // Create a feed @@ -32,54 +32,53 @@ describe('hello-world', () => { decimals, granularity, liveLength, - { - accounts: { - feed: feed.publicKey, - authority: owner.publicKey, - }, - signers: [feed], - preInstructions: [ - await storeProgram.account.transmissions.createInstruction(feed, 8+192+6*24), - ], - }); - - await storeProgram.rpc.setWriter( - owner.publicKey, { accounts: { feed: feed.publicKey, - owner: owner.publicKey, authority: owner.publicKey, }, - }); - + signers: [feed], + preInstructions: [ + await storeProgram.account.transmissions.createInstruction( + feed, + 8 + 192 + 6 * 24 + ), + ], + } + ); - const scale = (new BN(10)).pow(new BN(decimals)); + await storeProgram.rpc.setWriter(owner.publicKey, { + accounts: { + feed: feed.publicKey, + owner: owner.publicKey, + authority: owner.publicKey, + }, + }); + + const scale = new BN(10).pow(new BN(decimals)); // Scale answer to enough decimals - let answer = (new BN(1)).mul(scale); + let answer = new BN(1).mul(scale); let round = { timestamp: new BN(1), answer }; - let tx = await storeProgram.rpc.submit( - round, - { - accounts: { - store: store.publicKey, - feed: feed.publicKey, - authority: owner.publicKey, - }, - }); + let tx = await storeProgram.rpc.submit(round, { + accounts: { + store: store.publicKey, + feed: feed.publicKey, + authority: owner.publicKey, + }, + }); await provider.connection.confirmTransaction(tx); // Add your test here. tx = await program.rpc.execute({ - accounts: { - chainlinkFeed: feed.publicKey, - chainlinkProgram: CHAINLINK_PROGRAM_ID - }, - options: { commitment: "confirmed" }, + accounts: { + chainlinkFeed: feed.publicKey, + chainlinkProgram: CHAINLINK_PROGRAM_ID, + }, + options: { commitment: "confirmed" }, }); console.log("Your transaction signature", tx); let t = await provider.connection.getConfirmedTransaction(tx, "confirmed"); - console.log(t.meta.logMessages) + console.log(t.meta.logMessages); }); }); diff --git a/contracts/package.json b/contracts/package.json index 24b908a6e..0ffeea6b8 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,24 +1,25 @@ { - "dependencies": { - "@chainlink/solana-sdk": "../ts", - "@project-serum/anchor": "^0.25.0", - "@solana/spl-token": "^0.1.8", - "@solana/web3.js": "1.31.0", - "@types/chai": "^4.2.22", - "@types/mocha": "^9.0.0", - "@types/node": "^14.14.37", - "@types/secp256k1": "^4.0.3", - "bn.js": "^5.2.0", - "borsh": "^0.7.0", - "chai": "^4.3.4", - "ethereum-cryptography": "^0.1.3", - "mocha": "^9.0.0", - "prettier": "^2.5.1", - "secp256k1": "^4.0.2", - "ts-mocha": "^8.0.0", - "typescript": "^4.5.4" - }, - "scripts": { - "test": "yarn upgrade @chainlink/solana-sdk && ts-mocha -t 1000000 tests/*.ts" - } + "dependencies": { + "@chainlink/solana-sdk": "../ts", + "@project-serum/anchor": "^0.25.0", + "@solana/spl-token": "^0.1.8", + "@solana/web3.js": "1.31.0", + "@types/chai": "^4.2.22", + "@types/mocha": "^9.0.0", + "@types/node": "^14.14.37", + "@types/secp256k1": "^4.0.3", + "bn.js": "^5.2.0", + "borsh": "^0.7.0", + "chai": "^4.3.4", + "ethereum-cryptography": "^0.1.3", + "mocha": "^9.0.0", + "prettier": "^2.5.1", + "secp256k1": "^4.0.2", + "ts-mocha": "^8.0.0", + "typescript": "^4.5.4" + }, + "scripts": { + "format": "yarn prettier --write .", + "test": "yarn upgrade @chainlink/solana-sdk && ts-mocha -t 1000000 tests/*.ts" + } } diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 69923007a..57b668cff 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -119,7 +119,7 @@ describe("ocr2", async () => { epoch: number, round: number, answer: BN, - juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]), // juels per lamport (2) + juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]) // juels per lamport (2) ): Promise => { let account = await program.account.state.fetch(state.publicKey); @@ -335,36 +335,32 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; - await workspace.Store.rpc.createFeed( - description, - decimals, - granularity, - liveLength, - { - accounts: { - feed: feed.publicKey, - authority: owner.publicKey, - }, - signers: [feed], - preInstructions: [ - await workspace.Store.account.transmissions.createInstruction( - feed, - 8 + 192 + 6 * 48 - ), - ], - } - ); + await workspace.Store.methods + .createFeed(description, decimals, granularity, liveLength) + .accounts({ + feed: feed.publicKey, + authority: owner.publicKey, + }) + .signers([feed]) + .preInstructions([ + await workspace.Store.account.transmissions.createInstruction( + feed, + 8 + 192 + 6 * 48 + ), + ]) + .rpc(); // Program log: panicked at 'range end index 8 out of range for slice of length 0', store/src/lib.rs:476:10 // Configure threshold for the feed - await workspace.Store.rpc.setValidatorConfig(flaggingThreshold, { - accounts: { + await workspace.Store.methods + .setValidatorConfig(flaggingThreshold) + .accounts({ feed: feed.publicKey, owner: owner.publicKey, authority: owner.publicKey, - }, - signers: [], - }); + }) + .signers([]) + .rpc(); // store authority for our ocr2 config [storeAuthority, storeNonce] = await PublicKey.findProgramAddress( @@ -421,33 +417,30 @@ describe("ocr2", async () => { // }); it("Initializes the OCR2 config", async () => { - await program.rpc.initialize( - new BN(minAnswer), - new BN(maxAnswer), - { - accounts: { - state: state.publicKey, - feed: feed.publicKey, - payer: provider.wallet.publicKey, - owner: owner.publicKey, - tokenMint: token.publicKey, - tokenVault: tokenVault, - vaultAuthority: vaultAuthority, - requesterAccessController: requesterAccessController.publicKey, - billingAccessController: billingAccessController.publicKey, - rent: SYSVAR_RENT_PUBKEY, - systemProgram: SystemProgram.programId, - tokenProgram: TOKEN_PROGRAM_ID, - associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, - }, - signers: [state], - preInstructions: [ - await program.account.state.createInstruction(state), - // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), - // createFeed, - ], - } - ); + await program.methods + .initialize(new BN(minAnswer), new BN(maxAnswer)) + .accounts({ + state: state.publicKey, + feed: feed.publicKey, + payer: provider.wallet.publicKey, + owner: owner.publicKey, + tokenMint: token.publicKey, + tokenVault: tokenVault, + vaultAuthority: vaultAuthority, + requesterAccessController: requesterAccessController.publicKey, + billingAccessController: billingAccessController.publicKey, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + tokenProgram: TOKEN_PROGRAM_ID, + associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, + }) + .signers([state]) + .preInstructions([ + await program.account.state.createInstruction(state), + // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), + // createFeed, + ]) + .rpc(); let account = await program.account.state.fetch(state.publicKey); let config = account.config; @@ -534,16 +527,13 @@ describe("ocr2", async () => { console.log("proposePayees"); let payees = oracles.map((oracle) => oracle.payee.address); - await program.rpc.proposePayees( - token.publicKey, - { - accounts: { - proposal: proposal.publicKey, - authority: owner.publicKey, - }, - remainingAccounts: payees, - } - ); + await program.rpc.proposePayees(token.publicKey, { + accounts: { + proposal: proposal.publicKey, + authority: owner.publicKey, + }, + remainingAccounts: payees, + }); console.log("finalizeProposal"); await program.rpc.finalizeProposal({ @@ -554,22 +544,35 @@ describe("ocr2", async () => { }); // compute proposal digest - let proposalAccount = await program.account.proposal.fetch(proposal.publicKey); + let proposalAccount = await program.account.proposal.fetch( + proposal.publicKey + ); console.log(proposalAccount); - let proposalOracles = proposalAccount.oracles.xs.slice(0, proposalAccount.oracles.len); - let proposalOC = proposalAccount.offchainConfig.xs.slice(0, proposalAccount.offchainConfig.len); + let proposalOracles = proposalAccount.oracles.xs.slice( + 0, + proposalAccount.oracles.len + ); + let proposalOC = proposalAccount.offchainConfig.xs.slice( + 0, + proposalAccount.offchainConfig.len + ); - let hasher = createHash("sha256").update(Buffer.from([proposalAccount.oracles.len])); + let hasher = createHash("sha256").update( + Buffer.from([proposalAccount.oracles.len]) + ); hasher = proposalOracles.reduce((hasher, oracle) => { return hasher .update(Buffer.from(oracle.signer.key)) .update(oracle.transmitter.toBuffer()) - .update(oracle.payee.toBuffer()) + .update(oracle.payee.toBuffer()); }, hasher); - let offchainConfigHeader = Buffer.alloc(8+4); - offchainConfigHeader.writeBigUInt64BE(BigInt(proposalAccount.offchainConfig.version), 0); + let offchainConfigHeader = Buffer.alloc(8 + 4); + offchainConfigHeader.writeBigUInt64BE( + BigInt(proposalAccount.offchainConfig.version), + 0 + ); offchainConfigHeader.writeUInt32BE(proposalAccount.offchainConfig.len, 8); let digest = hasher @@ -829,12 +832,7 @@ describe("ocr2", async () => { const versionSchema = new Map([ [Round, { kind: "struct", fields: [["version", "u8"]] }], ]); - let data = await query( - feed.publicKey, - Scope.Version, - versionSchema, - Round - ); + let data = await query(feed.publicKey, Scope.Version, versionSchema, Round); assert.ok(data.version == 2); const descriptionSchema = new Map([ @@ -869,7 +867,7 @@ describe("ocr2", async () => { } }); - it ("Node payouts happen with the correct decimals", async () => { + it("Node payouts happen with the correct decimals", async () => { // fetch payees let account = await program.account.state.fetch(state.publicKey); let currentOracles = account.oracles.xs.slice(0, account.oracles.len); @@ -880,7 +878,10 @@ describe("ocr2", async () => { // + 2 juels per lamport => rounded to 0 // + 1 gjuel // = 1 gjuel - assert.equal(transmissionPayment*rounds, oracle.paymentGjuels.toNumber()) + assert.equal( + transmissionPayment * rounds, + oracle.paymentGjuels.toNumber() + ); transmitter = oracle.payee; } return { pubkey: oracle.payee, isWritable: true, isSigner: false }; @@ -899,44 +900,56 @@ describe("ocr2", async () => { }); for (let i = 0; i < payees.length; i++) { - const account = await tokenClient.getAccountInfo(payees[i].pubkey) + const account = await tokenClient.getAccountInfo(payees[i].pubkey); if (payees[i].pubkey.equals(transmitter)) { // transmitter + observation payment - assert.equal((observationPayment+transmissionPayment)*rounds, account.amount.toNumber()) + assert.equal( + (observationPayment + transmissionPayment) * rounds, + account.amount.toNumber() + ); continue; } // observation payment - assert.equal(observationPayment*rounds, account.amount.toNumber()) + assert.equal(observationPayment * rounds, account.amount.toNumber()); } - }); it("Transmit does not fail on juelsPerFeecoin edge cases", async () => { // zero value u64 juelsPerFeecoin - await transmit(rounds+1, rounds+1, new BN(rounds+1), Buffer.from([0, 0, 0, 0, 0, 0, 0, 0])); + await transmit( + rounds + 1, + rounds + 1, + new BN(rounds + 1), + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]) + ); // max value u64 juelsPerFeecoin - await transmit(rounds+2, rounds+2, new BN(rounds+2), Buffer.from([127, 127, 127, 127, 127, 127, 127, 127])); - }) + await transmit( + rounds + 2, + rounds + 2, + new BN(rounds + 2), + Buffer.from([127, 127, 127, 127, 127, 127, 127, 127]) + ); + }); - it("TS client listens and parses state", async () => { - let feed = new OCR2Feed(program, provider); - let listener = null; + // it("TS client listens and parses state", async () => { + // let feed = new OCR2Feed(program, provider); + // let listener = null; - let success = new Promise((resolve, _reject) => { - listener = feed.onRound(state.publicKey, (event) => { - resolve(event) - }); - }); + // let success = new Promise((resolve, _reject) => { + // listener = feed.onRound(state.publicKey, (event) => { + // resolve(event) + // }); + // }); - let transmitTx = transmit(100, 1, new BN(16)); - - let event = await success; - assert.ok(event.feed.equals(state.publicKey)) - assert.equal(event.answer.toNumber(), 16) + // let transmitTx = transmit(100, 1, new BN(16)); - await feed.removeListener(listener); - }) + // let event = await success; + // assert.ok(event.feed.equals(state.publicKey)) + // assert.equal(event.answer.toNumber(), 16) + + // await feed.removeListener(listener); + // }) it("Reclaims rent exempt deposit when closing down a feed", async () => { let beforeBalance = ( @@ -1006,13 +1019,13 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; - const header = 8 + 192 // account discriminator + header - const transmissionSize = 48 + const header = 8 + 192; // account discriminator + header + const transmissionSize = 48; const invalidLengths = [ header - 1, // insufficient for header size header + 6 * transmissionSize - 1, // incorrect size for ring buffer header + 2 * transmissionSize, // live length exceeds total capacity - ] + ]; for (let i = 0; i < invalidLengths.length; i++) { try { const invalidFeed = Keypair.generate(); @@ -1038,8 +1051,9 @@ describe("ocr2", async () => { } catch { continue; // expect error } - assert.fail(`create feed shouldn't have succeeded with account size ${invalidLengths[i]}`); + assert.fail( + `create feed shouldn't have succeeded with account size ${invalidLengths[i]}` + ); } }); - }); From c44f02bc3dbe0e37009df763e58d8e297a51998f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 14:12:05 +0900 Subject: [PATCH 16/47] update yarn lockfile --- contracts/yarn.lock | 87 +++++++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/contracts/yarn.lock b/contracts/yarn.lock index 2071ce67e..ddd357d04 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -10,9 +10,9 @@ regenerator-runtime "^0.13.4" "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2": - version "7.18.3" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4" - integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug== + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== dependencies: regenerator-runtime "^0.13.4" @@ -159,9 +159,9 @@ tweetnacl "^1.0.0" "@solana/web3.js@^1.36.0": - version "1.44.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.44.0.tgz#233f7bd268520a0ce852ff7f92ded150c5fad0f5" - integrity sha512-KHf7o8sM5FlxYGHGroD7IJeCCOmjFITdBIXq4cO5xPFQ8O6Y26FWfYqIXqY1dXI29t240g0m1GYPssCp5UVgZg== + version "1.50.1" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.50.1.tgz#dae726a06267d1bcd88b1e3cd8ae44c709302dcf" + integrity sha512-1l9N/nS8pJEA2YibNT8wa072718O0/A1eKWE0+pdWC5wDGQgBNxZSLuv7Cq5Dcn46WsZ5J5ZstK89q8J/ZZaQA== dependencies: "@babel/runtime" "^7.12.5" "@ethersproject/sha2" "^5.5.0" @@ -175,7 +175,8 @@ jayson "^3.4.4" js-sha3 "^0.8.0" node-fetch "2" - rpc-websockets "^7.4.2" + react-native-url-polyfill "^1.3.0" + rpc-websockets "^7.5.0" secp256k1 "^4.0.2" superstruct "^0.14.2" tweetnacl "^1.0.0" @@ -200,9 +201,9 @@ "@types/node" "*" "@types/express-serve-static-core@^4.17.9": - version "4.17.28" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" - integrity sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig== + version "4.17.30" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz#0f2f99617fa8f9696170c46152ccf7500b34ac04" + integrity sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ== dependencies: "@types/node" "*" "@types/qs" "*" @@ -224,9 +225,9 @@ integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== "@types/node@*": - version "17.0.41" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.41.tgz#1607b2fd3da014ae5d4d1b31bc792a39348dfb9b" - integrity sha512-xA6drNNeqb5YyV5fO3OAEsnXLfO7uF0whiOfPTz5AeDo8KeZFmODKnvwPymMNO8qE/an8pVY/O50tig2SQCrGw== + version "18.6.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.2.tgz#ffc5f0f099d27887c8d9067b54e55090fcd54126" + integrity sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ== "@types/node@^12.12.54": version "12.20.55" @@ -481,6 +482,14 @@ buffer@6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +buffer@^5.4.3: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + bufferutil@^4.0.1: version "4.0.6" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.6.tgz#ebd6c67c7922a0e902f053e5d8be5ec850e48433" @@ -848,7 +857,7 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -ieee754@^1.2.1: +ieee754@^1.1.13, 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== @@ -1120,9 +1129,9 @@ node-gyp-build@^4.2.0: integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== node-gyp-build@^4.3.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" - integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== + version "4.5.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.5.0.tgz#7a64eefa0b21112f89f58379da128ac177f20e40" + integrity sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -1191,6 +1200,11 @@ prettier@^2.5.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== +punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -1198,6 +1212,13 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" +react-native-url-polyfill@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz#c1763de0f2a8c22cc3e959b654c8790622b6ef6a" + integrity sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ== + dependencies: + whatwg-url-without-unicode "8.0.0-3" + readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" @@ -1232,7 +1253,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rpc-websockets@^7.4.2: +rpc-websockets@^7.4.2, rpc-websockets@^7.5.0: version "7.5.0" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748" integrity sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ== @@ -1471,12 +1492,26 @@ uuid@^8.3.2: webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +webidl-conversions@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" + integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== + +whatwg-url-without-unicode@8.0.0-3: + version "8.0.0-3" + resolved "https://registry.yarnpkg.com/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz#ab6df4bf6caaa6c85a59f6e82c026151d4bb376b" + integrity sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig== + dependencies: + buffer "^5.4.3" + punycode "^2.1.1" + webidl-conversions "^5.0.0" whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -1508,14 +1543,14 @@ wrappy@1: integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= ws@^7.4.5: - version "7.5.8" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" - integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== ws@^8.5.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.0.tgz#8e71c75e2f6348dbf8d78005107297056cb77769" - integrity sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ== + version "8.8.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" + integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== y18n@^5.0.5: version "5.0.8" From b76392140d01c01d46680eea188baea9d418781b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 14:43:59 +0900 Subject: [PATCH 17/47] format --- contracts/package.json | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index 0ffeea6b8..5b3d6faa7 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,25 +1,25 @@ { - "dependencies": { - "@chainlink/solana-sdk": "../ts", - "@project-serum/anchor": "^0.25.0", - "@solana/spl-token": "^0.1.8", - "@solana/web3.js": "1.31.0", - "@types/chai": "^4.2.22", - "@types/mocha": "^9.0.0", - "@types/node": "^14.14.37", - "@types/secp256k1": "^4.0.3", - "bn.js": "^5.2.0", - "borsh": "^0.7.0", - "chai": "^4.3.4", - "ethereum-cryptography": "^0.1.3", - "mocha": "^9.0.0", - "prettier": "^2.5.1", - "secp256k1": "^4.0.2", - "ts-mocha": "^8.0.0", - "typescript": "^4.5.4" - }, - "scripts": { - "format": "yarn prettier --write .", - "test": "yarn upgrade @chainlink/solana-sdk && ts-mocha -t 1000000 tests/*.ts" - } + "dependencies": { + "@chainlink/solana-sdk": "../ts", + "@project-serum/anchor": "^0.25.0", + "@solana/spl-token": "^0.2.0", + "@solana/web3.js": "^1.50.1", + "@types/chai": "^4.2.22", + "@types/mocha": "^9.0.0", + "@types/node": "^14.14.37", + "@types/secp256k1": "^4.0.3", + "bn.js": "^5.2.0", + "borsh": "^0.7.0", + "chai": "^4.3.4", + "ethereum-cryptography": "^0.1.3", + "mocha": "^9.0.0", + "prettier": "^2.5.1", + "secp256k1": "^4.0.2", + "ts-mocha": "^8.0.0", + "typescript": "^4.5.4" + }, + "scripts": { + "format": "yarn prettier --write .", + "test": "yarn upgrade @chainlink/solana-sdk && ts-mocha -t 1000000 tests/*.ts" + } } From 133dc93f58d282bc82e5a93044993fbf8aa43505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 14:44:18 +0900 Subject: [PATCH 18/47] Try upgrading to latest web3/spl-token to get tests to pass? --- contracts/tests/ocr2.spec.ts | 263 ++++++++++++++------------- contracts/yarn.lock | 335 +++++++++++++++++++++++++++++------ 2 files changed, 411 insertions(+), 187 deletions(-) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 57b668cff..929243635 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -3,6 +3,7 @@ import { ProgramError, BN } from "@project-serum/anchor"; import * as borsh from "borsh"; import { SYSVAR_RENT_PUBKEY, + LAMPORTS_PER_SOL, PublicKey, Keypair, SystemProgram, @@ -10,9 +11,14 @@ import { TransactionInstruction, } from "@solana/web3.js"; import { - Token, + createMint, + createAccount, + mintTo, + getAccount, + getOrCreateAssociatedTokenAccount, + getAssociatedTokenAddress, ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID } from "@solana/spl-token"; import { assert } from "chai"; @@ -50,6 +56,9 @@ describe("ocr2", async () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); + // Generate a new wallet keypair and airdrop SOL + const fromWallet = Keypair.generate(); + const billingAccessController = Keypair.generate(); const requesterAccessController = Keypair.generate(); const store = Keypair.generate(); @@ -79,7 +88,7 @@ describe("ocr2", async () => { const program = anchor.workspace.Ocr2; const accessController = anchor.workspace.AccessController; - let token: Token, tokenClient: Token; + let token: PublicKey; let storeAuthority: PublicKey, storeNonce: number; let tokenVault: PublicKey, vaultAuthority: PublicKey, vaultNonce: number; @@ -119,7 +128,7 @@ describe("ocr2", async () => { epoch: number, round: number, answer: BN, - juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]) // juels per lamport (2) + juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]), // juels per lamport (2) ): Promise => { let account = await program.account.state.fetch(state.publicKey); @@ -236,6 +245,8 @@ describe("ocr2", async () => { }; it("Funds the payer", async () => { + await provider.connection.requestAirdrop(fromWallet.publicKey, LAMPORTS_PER_SOL); + await provider.connection.confirmTransaction( await provider.connection.requestAirdrop(payer.publicKey, 10000000000), "confirmed" @@ -243,22 +254,21 @@ describe("ocr2", async () => { }); it("Creates the LINK token", async () => { - token = await Token.createMint( + token = await createMint( provider.connection, payer, mintAuthority.publicKey, null, 9, // SPL tokens use a u64, we can fit enough total supply in 9 decimals. Smallest unit is Gjuels - TOKEN_PROGRAM_ID ); - tokenClient = new Token( - provider.connection, - token.publicKey, - TOKEN_PROGRAM_ID, - // @ts-ignore - program.provider.wallet.payer - ); + // tokenClient = new Token( + // provider.connection, + // token.publicKey, + // TOKEN_PROGRAM_ID, + // // @ts-ignore + // program.provider.wallet.payer + // ); }); it("Creates access controllers", async () => { @@ -312,10 +322,8 @@ describe("ocr2", async () => { ); // Create an associated token account for LINK, owned by the program instance - tokenVault = await Token.getAssociatedTokenAddress( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, - token.publicKey, + tokenVault = await getAssociatedTokenAddress( + token, vaultAuthority, true // allowOwnerOffCurve: seems required since a PDA isn't a valid keypair ); @@ -328,39 +336,35 @@ describe("ocr2", async () => { console.log("feed", feed.publicKey.toBase58()); console.log("payer", provider.wallet.publicKey.toBase58()); console.log("owner", owner.publicKey.toBase58()); - console.log("tokenMint", token.publicKey.toBase58()); + console.log("tokenMint", token.toBase58()); console.log("tokenVault", tokenVault.toBase58()); console.log("vaultAuthority", vaultAuthority.toBase58()); console.log("placeholder", placeholder.toBase58()); const granularity = 30; const liveLength = 3; - await workspace.Store.methods - .createFeed(description, decimals, granularity, liveLength) - .accounts({ - feed: feed.publicKey, - authority: owner.publicKey, - }) - .signers([feed]) - .preInstructions([ - await workspace.Store.account.transmissions.createInstruction( - feed, - 8 + 192 + 6 * 48 - ), - ]) - .rpc(); + await workspace.Store.methods.createFeed( + description, + decimals, + granularity, + liveLength + ).accounts({ + feed: feed.publicKey, + authority: owner.publicKey, + }).signers([feed]).preInstructions([ + await workspace.Store.account.transmissions.createInstruction( + feed, + 8 + 192 + 6 * 48 + ), + ]).rpc(); // Program log: panicked at 'range end index 8 out of range for slice of length 0', store/src/lib.rs:476:10 // Configure threshold for the feed - await workspace.Store.methods - .setValidatorConfig(flaggingThreshold) - .accounts({ - feed: feed.publicKey, - owner: owner.publicKey, - authority: owner.publicKey, - }) - .signers([]) - .rpc(); + await workspace.Store.methods.setValidatorConfig(flaggingThreshold).accounts({ + feed: feed.publicKey, + owner: owner.publicKey, + authority: owner.publicKey, + }).signers([]).rpc(); // store authority for our ocr2 config [storeAuthority, storeNonce] = await PublicKey.findProgramAddress( @@ -417,31 +421,31 @@ describe("ocr2", async () => { // }); it("Initializes the OCR2 config", async () => { - await program.methods - .initialize(new BN(minAnswer), new BN(maxAnswer)) - .accounts({ - state: state.publicKey, - feed: feed.publicKey, - payer: provider.wallet.publicKey, - owner: owner.publicKey, - tokenMint: token.publicKey, - tokenVault: tokenVault, - vaultAuthority: vaultAuthority, - requesterAccessController: requesterAccessController.publicKey, - billingAccessController: billingAccessController.publicKey, - rent: SYSVAR_RENT_PUBKEY, - systemProgram: SystemProgram.programId, - tokenProgram: TOKEN_PROGRAM_ID, - associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, - }) - .signers([state]) - .preInstructions([ - await program.account.state.createInstruction(state), - // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), - // createFeed, - ]) - .rpc(); - + await (program.methods.initialize( + new BN(minAnswer), + new BN(maxAnswer), + ).accounts({ + state: state.publicKey, + feed: feed.publicKey, + payer: provider.wallet.publicKey, + owner: owner.publicKey, + tokenMint: token, + tokenVault: tokenVault, + vaultAuthority: vaultAuthority, + requesterAccessController: requesterAccessController.publicKey, + billingAccessController: billingAccessController.publicKey, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + tokenProgram: TOKEN_PROGRAM_ID, + associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, + }) + .signers([state]) + .preInstructions([ + await program.account.state.createInstruction(state), + // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), + // createFeed, + ]).rpc()); + let account = await program.account.state.fetch(state.publicKey); let config = account.config; assert.ok(config.minAnswer.toNumber() == minAnswer); @@ -460,7 +464,10 @@ describe("ocr2", async () => { }, transmitter, // Initialize a token account - payee: await token.getOrCreateAssociatedAccountInfo( + payee: await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, transmitter.publicKey ), }; @@ -474,11 +481,14 @@ describe("ocr2", async () => { const offchain_config = Buffer.from([4, 5, 6]); // Fund the owner with LINK tokens - await token.mintTo( + await mintTo( + provider.connection, + fromWallet, + token, tokenVault, mintAuthority.publicKey, + 100000000000000, [mintAuthority], - 100000000000000 ); // TODO: listen for SetConfig event @@ -527,13 +537,16 @@ describe("ocr2", async () => { console.log("proposePayees"); let payees = oracles.map((oracle) => oracle.payee.address); - await program.rpc.proposePayees(token.publicKey, { - accounts: { - proposal: proposal.publicKey, - authority: owner.publicKey, - }, - remainingAccounts: payees, - }); + await program.rpc.proposePayees( + token, + { + accounts: { + proposal: proposal.publicKey, + authority: owner.publicKey, + }, + remainingAccounts: payees, + } + ); console.log("finalizeProposal"); await program.rpc.finalizeProposal({ @@ -544,35 +557,22 @@ describe("ocr2", async () => { }); // compute proposal digest - let proposalAccount = await program.account.proposal.fetch( - proposal.publicKey - ); + let proposalAccount = await program.account.proposal.fetch(proposal.publicKey); console.log(proposalAccount); - let proposalOracles = proposalAccount.oracles.xs.slice( - 0, - proposalAccount.oracles.len - ); - let proposalOC = proposalAccount.offchainConfig.xs.slice( - 0, - proposalAccount.offchainConfig.len - ); + let proposalOracles = proposalAccount.oracles.xs.slice(0, proposalAccount.oracles.len); + let proposalOC = proposalAccount.offchainConfig.xs.slice(0, proposalAccount.offchainConfig.len); - let hasher = createHash("sha256").update( - Buffer.from([proposalAccount.oracles.len]) - ); + let hasher = createHash("sha256").update(Buffer.from([proposalAccount.oracles.len])); hasher = proposalOracles.reduce((hasher, oracle) => { return hasher .update(Buffer.from(oracle.signer.key)) .update(oracle.transmitter.toBuffer()) - .update(oracle.payee.toBuffer()); + .update(oracle.payee.toBuffer()) }, hasher); - let offchainConfigHeader = Buffer.alloc(8 + 4); - offchainConfigHeader.writeBigUInt64BE( - BigInt(proposalAccount.offchainConfig.version), - 0 - ); + let offchainConfigHeader = Buffer.alloc(8+4); + offchainConfigHeader.writeBigUInt64BE(BigInt(proposalAccount.offchainConfig.version), 0); offchainConfigHeader.writeUInt32BE(proposalAccount.offchainConfig.len, 8); let digest = hasher @@ -782,8 +782,15 @@ describe("ocr2", async () => { }); it("Withdraws funds", async () => { - const recipient = await token.createAccount(placeholder); - let recipientTokenAccount = await token.getOrCreateAssociatedAccountInfo( + const recipient = await createAccount( + provider.connection, + fromWallet, + token, + placeholder); + let recipientTokenAccount = await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, recipient ); @@ -800,10 +807,13 @@ describe("ocr2", async () => { signers: [], }); - recipientTokenAccount = await tokenClient.getOrCreateAssociatedAccountInfo( + recipientTokenAccount = await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, recipient ); - assert.ok(recipientTokenAccount.amount.toNumber() === 1); + assert.ok(recipientTokenAccount.amount === BigInt(1)); }); const roundSchema = new Map([ @@ -832,7 +842,12 @@ describe("ocr2", async () => { const versionSchema = new Map([ [Round, { kind: "struct", fields: [["version", "u8"]] }], ]); - let data = await query(feed.publicKey, Scope.Version, versionSchema, Round); + let data = await query( + feed.publicKey, + Scope.Version, + versionSchema, + Round + ); assert.ok(data.version == 2); const descriptionSchema = new Map([ @@ -867,7 +882,7 @@ describe("ocr2", async () => { } }); - it("Node payouts happen with the correct decimals", async () => { + it ("Node payouts happen with the correct decimals", async () => { // fetch payees let account = await program.account.state.fetch(state.publicKey); let currentOracles = account.oracles.xs.slice(0, account.oracles.len); @@ -878,10 +893,7 @@ describe("ocr2", async () => { // + 2 juels per lamport => rounded to 0 // + 1 gjuel // = 1 gjuel - assert.equal( - transmissionPayment * rounds, - oracle.paymentGjuels.toNumber() - ); + assert.equal(transmissionPayment*rounds, oracle.paymentGjuels.toNumber()) transmitter = oracle.payee; } return { pubkey: oracle.payee, isWritable: true, isSigner: false }; @@ -900,37 +912,25 @@ describe("ocr2", async () => { }); for (let i = 0; i < payees.length; i++) { - const account = await tokenClient.getAccountInfo(payees[i].pubkey); + const account = await getAccount(provider.connection, payees[i].pubkey) if (payees[i].pubkey.equals(transmitter)) { // transmitter + observation payment - assert.equal( - (observationPayment + transmissionPayment) * rounds, - account.amount.toNumber() - ); + assert.equal(BigInt((observationPayment+transmissionPayment)*rounds), account.amount) continue; } // observation payment - assert.equal(observationPayment * rounds, account.amount.toNumber()); + assert.equal(BigInt(observationPayment*rounds), account.amount) } + }); it("Transmit does not fail on juelsPerFeecoin edge cases", async () => { // zero value u64 juelsPerFeecoin - await transmit( - rounds + 1, - rounds + 1, - new BN(rounds + 1), - Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]) - ); + await transmit(rounds+1, rounds+1, new BN(rounds+1), Buffer.from([0, 0, 0, 0, 0, 0, 0, 0])); // max value u64 juelsPerFeecoin - await transmit( - rounds + 2, - rounds + 2, - new BN(rounds + 2), - Buffer.from([127, 127, 127, 127, 127, 127, 127, 127]) - ); - }); + await transmit(rounds+2, rounds+2, new BN(rounds+2), Buffer.from([127, 127, 127, 127, 127, 127, 127, 127])); + }) // it("TS client listens and parses state", async () => { // let feed = new OCR2Feed(program, provider); @@ -943,7 +943,7 @@ describe("ocr2", async () => { // }); // let transmitTx = transmit(100, 1, new BN(16)); - + // let event = await success; // assert.ok(event.feed.equals(state.publicKey)) // assert.equal(event.answer.toNumber(), 16) @@ -1019,13 +1019,13 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; - const header = 8 + 192; // account discriminator + header - const transmissionSize = 48; + const header = 8 + 192 // account discriminator + header + const transmissionSize = 48 const invalidLengths = [ header - 1, // insufficient for header size header + 6 * transmissionSize - 1, // incorrect size for ring buffer header + 2 * transmissionSize, // live length exceeds total capacity - ]; + ] for (let i = 0; i < invalidLengths.length; i++) { try { const invalidFeed = Keypair.generate(); @@ -1051,9 +1051,8 @@ describe("ocr2", async () => { } catch { continue; // expect error } - assert.fail( - `create feed shouldn't have succeeded with account size ${invalidLengths[i]}` - ); + assert.fail(`create feed shouldn't have succeeded with account size ${invalidLengths[i]}`); } }); + }); diff --git a/contracts/yarn.lock b/contracts/yarn.lock index ddd357d04..12cad2bb8 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -2,13 +2,6 @@ # yarn lockfile v1 -"@babel/runtime@^7.10.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" - "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" @@ -43,6 +36,18 @@ "@ethersproject/logger" "^5.6.0" hash.js "1.1.7" +"@hapi/hoek@^9.0.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@project-serum/anchor@^0.24.2": version "0.24.2" resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.24.2.tgz#a3c52a99605c80735f446ca9b3a4885034731004" @@ -92,6 +97,33 @@ bn.js "^5.1.2" buffer-layout "^1.2.0" +"@sideway/address@^4.1.3": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" + integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" + integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + +"@solana/buffer-layout-utils@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz#b45a6cab3293a2eb7597cceb474f229889d875ca" + integrity sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g== + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/web3.js" "^1.32.0" + bigint-buffer "^1.1.5" + bignumber.js "^9.0.1" + "@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" @@ -106,17 +138,15 @@ dependencies: buffer "~6.0.3" -"@solana/spl-token@^0.1.8": - version "0.1.8" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" - integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== +"@solana/spl-token@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.2.0.tgz#329bb6babb5de0f9c40035ddb1657f01a8347acd" + integrity sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ== dependencies: - "@babel/runtime" "^7.10.5" - "@solana/web3.js" "^1.21.0" - bn.js "^5.1.0" - buffer "6.0.3" - buffer-layout "^1.2.0" - dotenv "10.0.0" + "@solana/buffer-layout" "^4.0.0" + "@solana/buffer-layout-utils" "^0.2.0" + "@solana/web3.js" "^1.32.0" + start-server-and-test "^1.14.0" "@solana/web3.js@1.31.0": version "1.31.0" @@ -138,27 +168,7 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" -"@solana/web3.js@^1.21.0": - version "1.30.2" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.30.2.tgz#e85da75e0825dc64f53eb64a1ff0115b27bec135" - integrity sha512-hznCj+rkfvM5taRP3Z+l5lumB7IQnDrB4l55Wpsg4kDU9Zds8pE5YOH5Z9bbF/pUzZJKQjyBjnY/6kScBm3Ugg== - 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" - -"@solana/web3.js@^1.36.0": +"@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.50.1": version "1.50.1" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.50.1.tgz#dae726a06267d1bcd88b1e3cd8ae44c709302dcf" integrity sha512-1l9N/nS8pJEA2YibNT8wa072718O0/A1eKWE0+pdWC5wDGQgBNxZSLuv7Cq5Dcn46WsZ5J5ZstK89q8J/ZZaQA== @@ -323,6 +333,13 @@ assertion-error@^1.1.0: resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -347,6 +364,11 @@ bigint-buffer@^1.1.5: dependencies: bindings "^1.3.0" +bignumber.js@^9.0.1: + version "9.0.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" + integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -364,6 +386,11 @@ blakejs@^1.1.0: resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== +bluebird@3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -374,7 +401,7 @@ bn.js@^5.0.0, bn.js@^5.1.2: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -bn.js@^5.1.0, bn.js@^5.2.0: +bn.js@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== @@ -474,14 +501,6 @@ buffer@6.0.1: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@6.0.3, 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" - buffer@^5.4.3: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -490,6 +509,14 @@ buffer@^5.4.3: base64-js "^1.3.1" ieee754 "^1.1.13" +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.6" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.6.tgz#ebd6c67c7922a0e902f053e5d8be5ec850e48433" @@ -532,6 +559,11 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= +check-more-types@2.24.0: + version "2.24.0" + resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" + integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== + chokidar@3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" @@ -616,6 +648,15 @@ cross-fetch@^3.1.4, cross-fetch@^3.1.5: dependencies: node-fetch "2.6.7" +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-hash@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" @@ -663,10 +704,10 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -dotenv@10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" - integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== +duplexer@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" @@ -729,6 +770,19 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" +event-stream@=3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + integrity sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g== + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -742,6 +796,21 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +execa@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + eyes@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" @@ -777,6 +846,16 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== +follow-redirects@^1.14.0: + version "1.15.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" + integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -797,6 +876,11 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -857,6 +941,11 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -909,6 +998,11 @@ is-plain-obj@^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-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + 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" @@ -945,6 +1039,17 @@ jayson@^3.4.4: uuid "^8.3.2" ws "^7.4.5" +joi@^17.4.0: + version "17.6.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" + integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== + dependencies: + "@hapi/hoek" "^9.0.0" + "@hapi/topo" "^5.0.0" + "@sideway/address" "^4.1.3" + "@sideway/formula" "^3.0.0" + "@sideway/pinpoint" "^2.0.0" + js-sha256@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" @@ -988,6 +1093,11 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" +lazy-ass@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" + integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -995,7 +1105,7 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash@^4.17.20: +lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -1020,6 +1130,11 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + integrity sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -1029,6 +1144,16 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + 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" @@ -1138,6 +1263,13 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1145,6 +1277,13 @@ once@^1.3.0: dependencies: wrappy "1" +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -1174,11 +1313,23 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + integrity sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A== + dependencies: + through "~2.3" + pbkdf2@^3.0.17: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -1200,6 +1351,13 @@ prettier@^2.5.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== +ps-tree@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" + integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== + dependencies: + event-stream "=3.3.4" + punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -1266,6 +1424,13 @@ rpc-websockets@^7.4.2, rpc-websockets@^7.5.0: bufferutil "^4.0.1" utf-8-validate "^5.0.2" +rxjs@^7.1.0: + version "7.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" + integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== + dependencies: + tslib "^2.1.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -1314,6 +1479,23 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^3.0.3: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -1335,6 +1517,33 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + integrity sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA== + dependencies: + through "2" + +start-server-and-test@^1.14.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-1.14.0.tgz#c57f04f73eac15dd51733b551d775b40837fdde3" + integrity sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw== + dependencies: + bluebird "3.7.2" + check-more-types "2.24.0" + debug "4.3.2" + execa "5.1.1" + lazy-ass "1.6.0" + ps-tree "1.2.0" + wait-on "6.0.0" + +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + integrity sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw== + dependencies: + duplexer "~0.1.1" + 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" @@ -1363,6 +1572,11 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + 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" @@ -1397,7 +1611,7 @@ text-encoding-utf-8@^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": +through@2, "through@>=2.2.7 <3", through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== @@ -1452,7 +1666,7 @@ tsconfig-paths@^3.5.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^2.0.3: +tslib@^2.0.3, tslib@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== @@ -1489,6 +1703,17 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +wait-on@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-6.0.0.tgz#7e9bf8e3d7fe2daecbb7a570ac8ca41e9311c7e7" + integrity sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw== + dependencies: + axios "^0.21.1" + joi "^17.4.0" + lodash "^4.17.21" + minimist "^1.2.5" + rxjs "^7.1.0" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -1516,7 +1741,7 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which@2.0.2: +which@2.0.2, which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== From 3215711947589e203b18dab8a5e0e8d576feea4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:08:14 +0900 Subject: [PATCH 19/47] Update web3 dependency on the SDK too --- ts/package.json | 2 +- ts/yarn.lock | 138 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 96 insertions(+), 44 deletions(-) diff --git a/ts/package.json b/ts/package.json index 0046d8f21..e4c01a411 100644 --- a/ts/package.json +++ b/ts/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@project-serum/anchor": "^0.24.2", - "@solana/web3.js": "1.31.0" + "@solana/web3.js": "^1.50.1" }, "devDependencies": { "@types/eslint": "^8.2.1", diff --git a/ts/yarn.lock b/ts/yarn.lock index 6fbc7da5a..1f51fff5e 100644 --- a/ts/yarn.lock +++ b/ts/yarn.lock @@ -262,6 +262,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.17.2": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.16.7", "@babel/template@^7.3.3": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" @@ -628,13 +635,6 @@ dependencies: "@sinonjs/commons" "^1.7.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/buffer-layout@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz#75b1b11adc487234821c81dfae3119b73a5fd734" @@ -642,16 +642,16 @@ dependencies: buffer "~6.0.3" -"@solana/web3.js@1.31.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== +"@solana/web3.js@^1.36.0": + version "1.37.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.37.0.tgz#167b5b5d4aedc151237d9230b6142da068b0af34" + integrity sha512-O2iCcgkGdi2FXwVLztPIZHcBuZXdhbVLavMsG+RdEyFGzFD0tQN1rOJ+Xb5eaexjqtgcqRN+Fyg3wAhLcHJbiA== dependencies: "@babel/runtime" "^7.12.5" "@ethersproject/sha2" "^5.5.0" - "@solana/buffer-layout" "^3.0.0" + "@solana/buffer-layout" "^4.0.0" bn.js "^5.0.0" - borsh "^0.4.0" + borsh "^0.7.0" bs58 "^4.0.1" buffer "6.0.1" cross-fetch "^3.1.4" @@ -662,22 +662,25 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" -"@solana/web3.js@^1.36.0": - version "1.37.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.37.0.tgz#167b5b5d4aedc151237d9230b6142da068b0af34" - integrity sha512-O2iCcgkGdi2FXwVLztPIZHcBuZXdhbVLavMsG+RdEyFGzFD0tQN1rOJ+Xb5eaexjqtgcqRN+Fyg3wAhLcHJbiA== +"@solana/web3.js@^1.50.1": + version "1.50.1" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.50.1.tgz#dae726a06267d1bcd88b1e3cd8ae44c709302dcf" + integrity sha512-1l9N/nS8pJEA2YibNT8wa072718O0/A1eKWE0+pdWC5wDGQgBNxZSLuv7Cq5Dcn46WsZ5J5ZstK89q8J/ZZaQA== dependencies: "@babel/runtime" "^7.12.5" "@ethersproject/sha2" "^5.5.0" "@solana/buffer-layout" "^4.0.0" + bigint-buffer "^1.1.5" bn.js "^5.0.0" borsh "^0.7.0" bs58 "^4.0.1" buffer "6.0.1" - cross-fetch "^3.1.4" + fast-stable-stringify "^1.0.0" jayson "^3.4.4" js-sha3 "^0.8.0" - rpc-websockets "^7.4.2" + node-fetch "2" + react-native-url-polyfill "^1.3.0" + rpc-websockets "^7.5.0" secp256k1 "^4.0.2" superstruct "^0.14.2" tweetnacl "^1.0.0" @@ -740,13 +743,6 @@ dependencies: "@babel/types" "^7.3.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" @@ -1173,6 +1169,20 @@ base64-js@^1.3.1, base64-js@^1.5.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +bigint-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" + integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== + dependencies: + bindings "^1.3.0" + +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -1183,16 +1193,6 @@ bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^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" - borsh@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" @@ -1277,6 +1277,14 @@ buffer@6.0.1: base64-js "^1.3.1" ieee754 "^1.2.1" +buffer@^5.4.3: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + buffer@~6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -1842,6 +1850,11 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-stable-stringify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" + integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== + fastq@^1.6.0: version "1.13.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" @@ -1863,6 +1876,11 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -2070,7 +2088,7 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.2.1: +ieee754@^1.1.13, 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== @@ -2925,18 +2943,18 @@ node-addon-api@^2.0.0: 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-fetch@2.6.7: +node-fetch@2, node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" +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" @@ -3159,6 +3177,13 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-native-url-polyfill@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz#c1763de0f2a8c22cc3e959b654c8790622b6ef6a" + integrity sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ== + dependencies: + whatwg-url-without-unicode "8.0.0-3" + regenerator-runtime@^0.13.4: version "0.13.9" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" @@ -3231,6 +3256,19 @@ rpc-websockets@^7.4.2: bufferutil "^4.0.1" utf-8-validate "^5.0.2" +rpc-websockets@^7.5.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748" + integrity sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ== + dependencies: + "@babel/runtime" "^7.17.2" + eventemitter3 "^4.0.7" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -3725,6 +3763,15 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-url-without-unicode@8.0.0-3: + version "8.0.0-3" + resolved "https://registry.yarnpkg.com/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz#ab6df4bf6caaa6c85a59f6e82c026151d4bb376b" + integrity sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig== + dependencies: + buffer "^5.4.3" + punycode "^2.1.1" + webidl-conversions "^5.0.0" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -3788,6 +3835,11 @@ ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== +ws@^8.5.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" + integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" From c48918be23927ed7bbb7a863ec7f99045d7bc77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:16:40 +0900 Subject: [PATCH 20/47] Require token to be preallocated --- contracts/programs/ocr2/src/context.rs | 20 +++++++------------- contracts/tests/ocr2.spec.ts | 18 ++++++++++-------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/contracts/programs/ocr2/src/context.rs b/contracts/programs/ocr2/src/context.rs index 520bde481..b9926e066 100644 --- a/contracts/programs/ocr2/src/context.rs +++ b/contracts/programs/ocr2/src/context.rs @@ -1,6 +1,4 @@ use anchor_lang::prelude::*; -use anchor_lang::solana_program::sysvar; -use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token::{Mint, Token, TokenAccount, Transfer}; use crate::state::{Proposal, State}; @@ -15,14 +13,12 @@ pub struct Initialize<'info> { #[account(zero)] pub state: AccountLoader<'info, State>, pub feed: Account<'info, Transmissions>, - #[account(mut)] - pub payer: Signer<'info>, + // #[account(mut)] + // pub payer: Signer<'info>, pub owner: Signer<'info>, pub token_mint: Account<'info, Mint>, #[account( - init, - payer = payer, associated_token::mint = token_mint, associated_token::authority = vault_authority, )] @@ -33,13 +29,11 @@ pub struct Initialize<'info> { pub requester_access_controller: AccountLoader<'info, AccessController>, pub billing_access_controller: AccountLoader<'info, AccessController>, - - #[account(address = sysvar::rent::ID)] - pub rent: Sysvar<'info, Rent>, - - pub system_program: Program<'info, System>, - pub token_program: Program<'info, Token>, - pub associated_token_program: Program<'info, AssociatedToken>, + // #[account(address = sysvar::rent::ID)] + // pub rent: Sysvar<'info, Rent>, + // pub system_program: Program<'info, System>, + // pub token_program: Program<'info, Token>, + // pub associated_token_program: Program<'info, AssociatedToken>, } #[derive(Accounts)] diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 929243635..d4ca72c9a 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -322,11 +322,13 @@ describe("ocr2", async () => { ); // Create an associated token account for LINK, owned by the program instance - tokenVault = await getAssociatedTokenAddress( + tokenVault = (await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, token, vaultAuthority, true // allowOwnerOffCurve: seems required since a PDA isn't a valid keypair - ); + )).address; }); it("Initializes the OCR2 feed", async () => { @@ -427,21 +429,21 @@ describe("ocr2", async () => { ).accounts({ state: state.publicKey, feed: feed.publicKey, - payer: provider.wallet.publicKey, + // payer: provider.wallet.publicKey, owner: owner.publicKey, tokenMint: token, tokenVault: tokenVault, vaultAuthority: vaultAuthority, requesterAccessController: requesterAccessController.publicKey, billingAccessController: billingAccessController.publicKey, - rent: SYSVAR_RENT_PUBKEY, - systemProgram: SystemProgram.programId, - tokenProgram: TOKEN_PROGRAM_ID, - associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, + // rent: SYSVAR_RENT_PUBKEY, + // systemProgram: SystemProgram.programId, + // tokenProgram: TOKEN_PROGRAM_ID, + // associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, }) .signers([state]) .preInstructions([ - await program.account.state.createInstruction(state), + await program.account.state.createInstruction(state) // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), // createFeed, ]).rpc()); From dbf9bc5bbb3d1799db94a727ac3c51c7755fcde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:19:07 +0900 Subject: [PATCH 21/47] contracts yarn.lock web3 1.50 --- contracts/yarn.lock | 50 +++------------------------------------------ 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/contracts/yarn.lock b/contracts/yarn.lock index 12cad2bb8..0f7a7d964 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -13,7 +13,7 @@ version "0.2.2" dependencies: "@project-serum/anchor" "^0.24.2" - "@solana/web3.js" "1.31.0" + "@solana/web3.js" "^1.50.1" "@ethersproject/bytes@^5.6.1": version "5.6.1" @@ -124,13 +124,6 @@ bigint-buffer "^1.1.5" bignumber.js "^9.0.1" -"@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/buffer-layout@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz#75b1b11adc487234821c81dfae3119b73a5fd734" @@ -148,26 +141,6 @@ "@solana/web3.js" "^1.32.0" start-server-and-test "^1.14.0" -"@solana/web3.js@1.31.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" - "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.50.1": version "1.50.1" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.50.1.tgz#dae726a06267d1bcd88b1e3cd8ae44c709302dcf" @@ -191,13 +164,6 @@ 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/chai@^4.2.22": version "4.3.0" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.0.tgz#23509ebc1fa32f1b4d50d6a66c4032d5b8eaabdc" @@ -406,16 +372,6 @@ bn.js@^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" - borsh@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" @@ -641,7 +597,7 @@ create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-fetch@^3.1.4, cross-fetch@^3.1.5: +cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== @@ -1411,7 +1367,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rpc-websockets@^7.4.2, rpc-websockets@^7.5.0: +rpc-websockets@^7.5.0: version "7.5.0" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748" integrity sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ== From 763a5bf6a77d506f316554fd46715ce8ca522549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:36:32 +0900 Subject: [PATCH 22/47] Pass proposePayees as AccountMeta --- contracts/tests/ocr2.spec.ts | 29 +++++++++---------- .../commands/contracts/ocr2/proposePayees.ts | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index d4ca72c9a..d55fe4cb5 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -538,25 +538,24 @@ describe("ocr2", async () => { }); console.log("proposePayees"); - let payees = oracles.map((oracle) => oracle.payee.address); - await program.rpc.proposePayees( - token, - { - accounts: { - proposal: proposal.publicKey, - authority: owner.publicKey, - }, - remainingAccounts: payees, - } - ); + let payees = oracles.map((oracle) => { + return { pubkey: oracle.payee.address, isWritable: true, isSigner: false }; + }); + await program.methods.proposePayees(token) + .accounts({ + proposal: proposal.publicKey, + authority: owner.publicKey, + }) + .remainingAccounts(payees) + .rpc(); console.log("finalizeProposal"); - await program.rpc.finalizeProposal({ - accounts: { + await program.methods.finalizeProposal() + .accounts({ proposal: proposal.publicKey, authority: owner.publicKey, - }, - }); + }) + .rpc(); // compute proposal digest let proposalAccount = await program.account.proposal.fetch(proposal.publicKey); diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index 84e48e199..8d89db334 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -119,7 +119,7 @@ export default class ProposePayees extends SolanaCommand { const proposalInfo = (await this.program.account.proposal.fetch(proposal)) as any const payees = proposalInfo.oracles.xs .slice(0, proposalInfo.oracles.len) - .map(({ transmitter }) => this.contractInput.payeeByTransmitter[transmitter.toString()]) + .map(({ transmitter }) => ({ pubkey: this.contractInput.payeeByTransmitter[transmitter.toString()], isWritable: true, isSigner: false })); const ix = await this.program.methods .proposePayees(token.publicKey) From cb9d77526c5379be2dcf86f95415dbe08160ff23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:37:56 +0900 Subject: [PATCH 23/47] get the last test passing again --- contracts/tests/ocr2.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index d55fe4cb5..88d8032fb 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -788,11 +788,13 @@ describe("ocr2", async () => { fromWallet, token, placeholder); + // TODO: it complains account is off curve let recipientTokenAccount = await getOrCreateAssociatedTokenAccount( provider.connection, fromWallet, token, - recipient + recipient, + true ); await program.rpc.withdrawFunds(new BN(1), { @@ -808,11 +810,13 @@ describe("ocr2", async () => { signers: [], }); + // TODO: it complains account is off curve recipientTokenAccount = await getOrCreateAssociatedTokenAccount( provider.connection, fromWallet, token, - recipient + recipient, + true ); assert.ok(recipientTokenAccount.amount === BigInt(1)); }); From 67f70d8171d7bd67aa87477c2f6284e6056115c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:40:17 +0900 Subject: [PATCH 24/47] Re-enable test case --- contracts/tests/ocr2.spec.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 88d8032fb..8dfddd880 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -937,24 +937,24 @@ describe("ocr2", async () => { await transmit(rounds+2, rounds+2, new BN(rounds+2), Buffer.from([127, 127, 127, 127, 127, 127, 127, 127])); }) - // it("TS client listens and parses state", async () => { - // let feed = new OCR2Feed(program, provider); - // let listener = null; + it("TS client listens and parses state", async () => { + let feed = new OCR2Feed(program, provider); + let listener = null; - // let success = new Promise((resolve, _reject) => { - // listener = feed.onRound(state.publicKey, (event) => { - // resolve(event) - // }); - // }); + let success = new Promise((resolve, _reject) => { + listener = feed.onRound(state.publicKey, (event) => { + resolve(event) + }); + }); - // let transmitTx = transmit(100, 1, new BN(16)); + let transmitTx = transmit(100, 1, new BN(16)); - // let event = await success; - // assert.ok(event.feed.equals(state.publicKey)) - // assert.equal(event.answer.toNumber(), 16) + let event = await success; + assert.ok(event.feed.equals(state.publicKey)) + assert.equal(event.answer.toNumber(), 16) - // await feed.removeListener(listener); - // }) + await feed.removeListener(listener); + }) it("Reclaims rent exempt deposit when closing down a feed", async () => { let beforeBalance = ( From c5c6bf7d732874ed6f00957fc2194502bc3794e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:45:53 +0900 Subject: [PATCH 25/47] Update gauntlet's web3 and token packages too --- .../gauntlet-serum-multisig/package.json | 2 +- .../gauntlet-solana-contracts/package.json | 4 +- .../src/commands/contracts/ocr2/initialize.ts | 1 + .../packages/gauntlet-solana/package.json | 2 +- gauntlet/yarn.lock | 362 +++++++++++++++--- 5 files changed, 317 insertions(+), 54 deletions(-) diff --git a/gauntlet/packages/gauntlet-serum-multisig/package.json b/gauntlet/packages/gauntlet-serum-multisig/package.json index 65cb754f4..6ed0551c5 100644 --- a/gauntlet/packages/gauntlet-serum-multisig/package.json +++ b/gauntlet/packages/gauntlet-serum-multisig/package.json @@ -28,6 +28,6 @@ "@chainlink/gauntlet-core": "0.1.2", "@chainlink/gauntlet-solana": "*", "@project-serum/anchor": "^0.25.0", - "@solana/web3.js": "^1.31.0" + "@solana/web3.js": "^1.50.1" } } diff --git a/gauntlet/packages/gauntlet-solana-contracts/package.json b/gauntlet/packages/gauntlet-solana-contracts/package.json index 0a51f4831..e091e09a6 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/package.json +++ b/gauntlet/packages/gauntlet-solana-contracts/package.json @@ -29,8 +29,8 @@ "@chainlink/gauntlet-solana": "*", "@chainlink/gauntlet-serum-multisig": "*", "@ethersproject/keccak256": "^5.5.0", - "@solana/spl-token": "^0.1.8", - "@solana/web3.js": "^1.31.0", + "@solana/spl-token": "^0.2.0", + "@solana/web3.js": "^1.50.1", "protobufjs": "^6.11.2" } } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index 660d2f60a..71be90411 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -64,6 +64,7 @@ export default class Initialize extends SolanaCommand { const maxAnswer = new BN(input.maxAnswer) const transmissions = new PublicKey(input.transmissions) + // TODO: use getOrCreateAssociatedTokenAccount const tokenVault = await Token.getAssociatedTokenAddress( ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, diff --git a/gauntlet/packages/gauntlet-solana/package.json b/gauntlet/packages/gauntlet-solana/package.json index 7e5bf97fd..9162adbd3 100644 --- a/gauntlet/packages/gauntlet-solana/package.json +++ b/gauntlet/packages/gauntlet-solana/package.json @@ -30,6 +30,6 @@ "@ledgerhq/hw-transport-node-hid": "^6.20.0", "@project-serum/anchor": "^0.25.0", "@project-serum/borsh": "^0.2.2", - "@solana/web3.js": "^1.31.0" + "@solana/web3.js": "^1.50.1" } } diff --git a/gauntlet/yarn.lock b/gauntlet/yarn.lock index 22f81f5f0..64dcc9671 100644 --- a/gauntlet/yarn.lock +++ b/gauntlet/yarn.lock @@ -270,10 +270,10 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.5": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" - integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== +"@babel/runtime@^7.17.2": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== dependencies: regenerator-runtime "^0.13.4" @@ -554,6 +554,18 @@ "@ethersproject/logger" "^5.5.0" hash.js "1.1.7" +"@hapi/hoek@^9.0.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -938,6 +950,23 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= +"@sideway/address@^4.1.3": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" + integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" + integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -952,6 +981,16 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@solana/buffer-layout-utils@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz#b45a6cab3293a2eb7597cceb474f229889d875ca" + integrity sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g== + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/web3.js" "^1.32.0" + bigint-buffer "^1.1.5" + bignumber.js "^9.0.1" + "@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" @@ -959,39 +998,47 @@ dependencies: buffer "~6.0.3" -"@solana/spl-token@^0.1.8": - version "0.1.8" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" - integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== +"@solana/buffer-layout@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz#75b1b11adc487234821c81dfae3119b73a5fd734" + integrity sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ== dependencies: - "@babel/runtime" "^7.10.5" - "@solana/web3.js" "^1.21.0" - bn.js "^5.1.0" - buffer "6.0.3" - buffer-layout "^1.2.0" - dotenv "10.0.0" + buffer "~6.0.3" + +"@solana/spl-token@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.2.0.tgz#329bb6babb5de0f9c40035ddb1657f01a8347acd" + integrity sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ== + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/buffer-layout-utils" "^0.2.0" + "@solana/web3.js" "^1.32.0" + start-server-and-test "^1.14.0" -"@solana/web3.js@^1.21.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== +"@solana/web3.js@^1.32.0", "@solana/web3.js@^1.50.1": + version "1.50.1" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.50.1.tgz#dae726a06267d1bcd88b1e3cd8ae44c709302dcf" + integrity sha512-1l9N/nS8pJEA2YibNT8wa072718O0/A1eKWE0+pdWC5wDGQgBNxZSLuv7Cq5Dcn46WsZ5J5ZstK89q8J/ZZaQA== dependencies: "@babel/runtime" "^7.12.5" "@ethersproject/sha2" "^5.5.0" - "@solana/buffer-layout" "^3.0.0" + "@solana/buffer-layout" "^4.0.0" + bigint-buffer "^1.1.5" bn.js "^5.0.0" - borsh "^0.4.0" + borsh "^0.7.0" bs58 "^4.0.1" buffer "6.0.1" - cross-fetch "^3.1.4" + fast-stable-stringify "^1.0.0" jayson "^3.4.4" js-sha3 "^0.8.0" - rpc-websockets "^7.4.2" + node-fetch "2" + react-native-url-polyfill "^1.3.0" + rpc-websockets "^7.5.0" secp256k1 "^4.0.2" superstruct "^0.14.2" tweetnacl "^1.0.0" -"@solana/web3.js@^1.31.0", "@solana/web3.js@^1.36.0": +"@solana/web3.js@^1.36.0": version "1.36.0" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.36.0.tgz#79d7d5217b49b80139f4de68953adc5b9a9a264f" integrity sha512-RNT1451iRR7TyW7EJKMCrH/0OXawIe4zVm0DWQASwXlR/u1jmW6FrmH0lujIh7cGTlfOVbH+2ZU9AVUPLBFzwA== @@ -1384,6 +1431,13 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + axios@^0.24.0: version "0.24.0" resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" @@ -1489,7 +1543,19 @@ better-path-resolve@1.0.0: dependencies: is-windows "^1.0.0" -bindings@^1.5.0: +bigint-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" + integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== + dependencies: + bindings "^1.3.0" + +bignumber.js@^9.0.1: + version "9.0.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" + integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== + +bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -1510,12 +1576,17 @@ bl@^4.0.3: inherits "^2.0.4" readable-stream "^3.4.0" +bluebird@3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + 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.0, bn.js@^5.1.2, bn.js@^5.2.0: +bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== @@ -1530,6 +1601,15 @@ borsh@^0.4.0: bs58 "^4.0.0" text-encoding-utf-8 "^1.0.2" +borsh@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" + integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA== + dependencies: + bn.js "^5.2.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + boxen@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" @@ -1641,15 +1721,7 @@ buffer@6.0.1: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@6.0.3, 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" - -buffer@^5.5.0: +buffer@^5.4.3, buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -1657,6 +1729,14 @@ buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" +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" @@ -1755,6 +1835,11 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +check-more-types@2.24.0: + version "2.24.0" + resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" + integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== + chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -1938,7 +2023,7 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0: +cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2003,7 +2088,7 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1: +debug@4, debug@4.3.2, debug@^4.1.0, debug@^4.1.1: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -2153,10 +2238,10 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -dotenv@10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" - integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== +duplexer@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== electron-to-chromium@^1.3.896: version "1.3.899" @@ -2261,6 +2346,19 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +event-stream@=3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + integrity sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g== + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -2276,6 +2374,21 @@ exec-sh@^0.3.2: resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== +execa@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -2421,6 +2534,11 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-stable-stringify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" + integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== + fastq@^1.6.0: version "1.13.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" @@ -2481,6 +2599,11 @@ find-yarn-workspace-root2@1.2.16: micromatch "^4.0.2" pkg-dir "^4.2.0" +follow-redirects@^1.14.0: + version "1.15.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" + integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + follow-redirects@^1.14.4: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" @@ -2515,6 +2638,11 @@ from2@^2.3.0: inherits "^2.0.1" readable-stream "^2.0.0" +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== + fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -2611,6 +2739,11 @@ get-stream@^5.0.0: dependencies: pump "^3.0.0" +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -2791,6 +2924,11 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -3509,6 +3647,17 @@ jest@^26.6.3: import-local "^3.0.2" jest-cli "^26.6.3" +joi@^17.4.0: + version "17.6.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" + integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== + dependencies: + "@hapi/hoek" "^9.0.0" + "@hapi/topo" "^5.0.0" + "@sideway/address" "^4.1.3" + "@sideway/formula" "^3.0.0" + "@sideway/pinpoint" "^2.0.0" + js-sha256@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" @@ -3637,6 +3786,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +lazy-ass@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" + integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== + leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -3750,6 +3904,11 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + integrity sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g== + map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" @@ -3972,18 +4131,18 @@ node-addon-api@^4.2.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== -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-fetch@2.6.7: +node-fetch@2, node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" +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-fetch@^2.6.1: version "2.6.6" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" @@ -4066,7 +4225,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.0: +npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -4128,7 +4287,7 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -onetime@^5.1.0: +onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -4272,6 +4431,13 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + integrity sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A== + dependencies: + through "~2.3" + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -4452,6 +4618,13 @@ protobufjs@^6.11.2: "@types/node" ">=13.7.0" long "^4.0.0" +ps-tree@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" + integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== + dependencies: + event-stream "=3.3.4" + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -4500,6 +4673,13 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-native-url-polyfill@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz#c1763de0f2a8c22cc3e959b654c8790622b6ef6a" + integrity sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ== + dependencies: + whatwg-url-without-unicode "8.0.0-3" + read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -4653,6 +4833,19 @@ rpc-websockets@^7.4.2: bufferutil "^4.0.1" utf-8-validate "^5.0.2" +rpc-websockets@^7.5.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748" + integrity sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ== + dependencies: + "@babel/runtime" "^7.17.2" + eventemitter3 "^4.0.7" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -4672,6 +4865,13 @@ rxjs@6: dependencies: tslib "^1.9.0" +rxjs@^7.1.0: + version "7.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" + integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== + dependencies: + tslib "^2.1.0" + safe-buffer@^5.0.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -4791,6 +4991,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== +signal-exit@^3.0.3: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -4944,6 +5149,13 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + integrity sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA== + dependencies: + through "2" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -4956,6 +5168,19 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" +start-server-and-test@^1.14.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-1.14.0.tgz#c57f04f73eac15dd51733b551d775b40837fdde3" + integrity sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw== + dependencies: + bluebird "3.7.2" + check-more-types "2.24.0" + debug "4.3.2" + execa "5.1.1" + lazy-ass "1.6.0" + ps-tree "1.2.0" + wait-on "6.0.0" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -4964,6 +5189,13 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + integrity sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw== + dependencies: + duplexer "~0.1.1" + stream-meter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/stream-meter/-/stream-meter-1.0.4.tgz#52af95aa5ea760a2491716704dbff90f73afdd1d" @@ -5176,7 +5408,7 @@ throat@^5.0.0: resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== -"through@>=2.2.7 <3": +through@2, "through@>=2.2.7 <3", through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -5303,6 +5535,11 @@ tslib@^2.0.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tty-table@^2.8.10: version "2.8.13" resolved "https://registry.yarnpkg.com/tty-table/-/tty-table-2.8.13.tgz#d484a416381973eaebbdf19c79136b390e5c6d70" @@ -5434,7 +5671,7 @@ uuid@^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: +uuid@^8.3.0, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -5470,6 +5707,17 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" +wait-on@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-6.0.0.tgz#7e9bf8e3d7fe2daecbb7a570ac8ca41e9311c7e7" + integrity sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw== + dependencies: + axios "^0.21.1" + joi "^17.4.0" + lodash "^4.17.21" + minimist "^1.2.5" + rxjs "^7.1.0" + walker@^1.0.7, walker@~1.0.5: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" @@ -5511,6 +5759,15 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-url-without-unicode@8.0.0-3: + version "8.0.0-3" + resolved "https://registry.yarnpkg.com/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz#ab6df4bf6caaa6c85a59f6e82c026151d4bb376b" + integrity sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig== + dependencies: + buffer "^5.4.3" + punycode "^2.1.1" + webidl-conversions "^5.0.0" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -5617,6 +5874,11 @@ ws@^7.4.5, ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== +ws@^8.5.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" + integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" From 982a6a59ced57008dd06dec975fd941b9c44b8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 15:50:49 +0900 Subject: [PATCH 26/47] wip resolving token lib differences --- .../commands/contracts/token/createAccount.ts | 22 ++++++++----------- .../src/lib/utils.ts | 7 +++--- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts index 90b71c51a..1d2b3e0f9 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { logger, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { ASSOCIATED_TOKEN_PROGRAM_ID, Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, createAssociatedTokenAccountInstruction, getAssociatedTokenAddress } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' import { CONTRACT_LIST } from '../../../lib/contracts' import { isValidTokenAccount } from './utils' @@ -22,18 +22,16 @@ export default class CreateAccount extends SolanaCommand { const tokenAddress = new PublicKey(this.args[0]) const newAccountBase = new PublicKey(this.flags.address) - const associatedAcc = await Token.getAssociatedTokenAddress( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, + const associatedAcc = await getAssociatedTokenAddress( tokenAddress, newAccountBase, true, ) - const token = new Token(this.provider.connection, tokenAddress, TOKEN_PROGRAM_ID, { - publicKey: this.wallet.publicKey, - secretKey: Buffer.from([]), - }) + // const token = new Token(this.provider.connection, tokenAddress, TOKEN_PROGRAM_ID, { + // publicKey: this.wallet.publicKey, + // secretKey: Buffer.from([]), + // }) const accountExists = await isValidTokenAccount(token, associatedAcc) this.require( @@ -41,13 +39,11 @@ export default class CreateAccount extends SolanaCommand { `A Token Associated Account to address ${newAccountBase.toString()} already exists: ${associatedAcc}`, ) - const ix = Token.createAssociatedTokenAccountInstruction( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, - tokenAddress, + const ix = createAssociatedTokenAccountInstruction( + this.wallet.publicKey, associatedAcc, newAccountBase, - this.wallet.publicKey, + tokenAddress, ) await prompt(`Continue to create new Token associated account to ${newAccountBase.toString()}`) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/lib/utils.ts b/gauntlet/packages/gauntlet-solana-contracts/src/lib/utils.ts index 77aa2caee..4b0ef4285 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/lib/utils.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/lib/utils.ts @@ -1,4 +1,3 @@ -import { Transaction, TransactionCtorFields, TransactionInstruction } from '@solana/web3.js' import * as BufferLayout from '@solana/buffer-layout' export const divideIntoChunks = (arr: Array | Buffer, chunkSize: number): any[][] => { @@ -15,15 +14,15 @@ export const divideIntoChunks = (arr: Array | Buffer, chunkSize: number): a export const encodeInstruction = (data: any): Buffer => { const CHUNK_SIZE = 900 - const dataLayout = BufferLayout.union(BufferLayout.u32('tag'), null, 'tag') + const dataLayout = BufferLayout.union(BufferLayout.u32('tag') as BufferLayout.Layout, null, 'tag') dataLayout.addVariant(0, BufferLayout.struct([]), 'InitializeBuffer') - const write = BufferLayout.struct([ + const write = BufferLayout.struct([ BufferLayout.u32('offset'), BufferLayout.nu64('length'), BufferLayout.seq(BufferLayout.u8('byte'), BufferLayout.offset(BufferLayout.u32(), -8), 'bytes'), ]) dataLayout.addVariant(1, write, 'Write') - const deployWithMaxLen = BufferLayout.struct([BufferLayout.nu64('max_data_len')]) + const deployWithMaxLen = BufferLayout.struct([BufferLayout.nu64('max_data_len')]) dataLayout.addVariant(2, deployWithMaxLen, 'DeployWithMaxDataLen') dataLayout.addVariant(3, BufferLayout.struct([]), 'Upgrade') dataLayout.addVariant(4, BufferLayout.struct([]), 'SetAuthority') From 437b5c27bba3173673612cf9e3485f63d3b24816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 28 Jul 2022 17:01:58 +0900 Subject: [PATCH 27/47] wip --- .../src/commands/contracts/ocr2/initialize.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index 71be90411..e72fee45d 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' import { Keypair, PublicKey, TransactionInstruction, SystemProgram, SYSVAR_RENT_PUBKEY } from '@solana/web3.js' -import { ASSOCIATED_TOKEN_PROGRAM_ID, Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { ASSOCIATED_TOKEN_PROGRAM_ID, getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' import { utils } from '@project-serum/anchor' import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' @@ -64,31 +64,25 @@ export default class Initialize extends SolanaCommand { const maxAnswer = new BN(input.maxAnswer) const transmissions = new PublicKey(input.transmissions) - // TODO: use getOrCreateAssociatedTokenAccount - const tokenVault = await Token.getAssociatedTokenAddress( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, + const tokenVault = (await getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.provider.wallet, linkPublicKey, vaultAuthority, true, - ) + )).address const tx = await program.methods .initialize(minAnswer, maxAnswer) .accounts({ state, feed: transmissions, - payer: signer, owner: signer, tokenMint: linkPublicKey, tokenVault, vaultAuthority, requesterAccessController, billingAccessController, - rent: SYSVAR_RENT_PUBKEY, - systemProgram: SystemProgram.programId, - tokenProgram: TOKEN_PROGRAM_ID, - associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, }) .instruction() @@ -101,7 +95,7 @@ export default class Initialize extends SolanaCommand { `) const defaultAccountSize = new BN(program.account.state.size) - const feedCreationInstruction = await SystemProgram.createAccount({ + const feedCreationInstruction = SystemProgram.createAccount({ fromPubkey: signer, newAccountPubkey: state, space: defaultAccountSize.toNumber(), From 26084af33705585753d69b8beabf60a81c37506b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 29 Jul 2022 12:43:32 +0900 Subject: [PATCH 28/47] Fix remaining gauntlet issues --- .../src/commands/contracts/ocr2/fund.ts | 13 ++------- .../src/commands/contracts/ocr2/initialize.ts | 4 +-- .../commands/contracts/ocr2/proposePayees.ts | 11 ++----- .../commands/contracts/token/createAccount.ts | 9 ++---- .../src/commands/contracts/token/deploy.ts | 19 ++++++------ .../src/commands/contracts/token/read.ts | 6 ++-- .../src/commands/contracts/token/transfer.ts | 29 +++++-------------- .../src/commands/contracts/token/utils.ts | 10 +++---- 8 files changed, 33 insertions(+), 68 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts index 7d541c67d..392d68422 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' import { PublicKey } from '@solana/web3.js' -import { ASSOCIATED_TOKEN_PROGRAM_ID, Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { getAssociatedTokenAddress, transfer } from '@solana/spl-token' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' import { logger, BN } from '@chainlink/gauntlet-core/dist/utils' @@ -33,17 +33,10 @@ export default class Fund extends SolanaCommand { const tokenMint = stateAccount.config.tokenMint this.require(tokenMint.equals(linkPublicKey), 'LINK does not match aggregator.config.tokenMint') - const token = new Token(this.provider.connection, linkPublicKey, TOKEN_PROGRAM_ID, this.wallet.payer) - - const from = await Token.getAssociatedTokenAddress( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, - token.publicKey, - this.wallet.publicKey, - ) + const from = await getAssociatedTokenAddress(linkPublicKey, this.wallet.publicKey) logger.loading(`Transferring ${amount} tokens to ${state.toString()} token vault ${tokenVault.toString()}...`) - const tx = await token.transfer(from, tokenVault, this.wallet.payer, [], amount.toNumber()) + const tx = await transfer(this.provider.connection, this.wallet.payer, from, tokenVault, this.wallet.payer, amount.toNumber()) return { responses: [ diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index e72fee45d..c2429827f 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -66,7 +66,7 @@ export default class Initialize extends SolanaCommand { const tokenVault = (await getOrCreateAssociatedTokenAccount( this.provider.connection, - this.provider.wallet, + this.wallet.payer, linkPublicKey, vaultAuthority, true, @@ -90,7 +90,7 @@ export default class Initialize extends SolanaCommand { STATE ACCOUNTS: - State: ${state?.toString()} - Transmissions: ${transmissions} - - Payer: ${this.provider.wallet.publicKey} + - Payer: ${this.wallet.publicKey} - Owner: ${signer.toString()} `) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index 8d89db334..aa6b527fb 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -2,7 +2,7 @@ import { Result } from '@chainlink/gauntlet-core' import { logger, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' import { PublicKey } from '@solana/web3.js' -import { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { getAccount } from '@solana/spl-token' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' import RDD from '../../../lib/rdd' import { printDiff } from '../../../lib/diff' @@ -89,16 +89,11 @@ export default class ProposePayees extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const link = new PublicKey(this.flags.link || process.env.LINK) - const token = new Token(this.provider.connection, link, TOKEN_PROGRAM_ID, { - publicKey: signer, - secretKey: Buffer.from([]), - }) - const areValidPayees = ( await Promise.all( Object.entries(this.contractInput.payeeByTransmitter).map(async ([transmitter, payee]) => { try { - const info = await token.getAccountInfo(new PublicKey(payee)) + const info = await getAccount(this.provider.connection, payee) return !!info.address } catch (e) { logger.error(`Payee with address ${payee} does not have a valid Token recipient address`) @@ -122,7 +117,7 @@ export default class ProposePayees extends SolanaCommand { .map(({ transmitter }) => ({ pubkey: this.contractInput.payeeByTransmitter[transmitter.toString()], isWritable: true, isSigner: false })); const ix = await this.program.methods - .proposePayees(token.publicKey) + .proposePayees(link) .accounts({ proposal, authority: signer, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts index 1d2b3e0f9..6795d33e7 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { logger, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, createAssociatedTokenAccountInstruction, getAssociatedTokenAddress } from '@solana/spl-token' +import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddress } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' import { CONTRACT_LIST } from '../../../lib/contracts' import { isValidTokenAccount } from './utils' @@ -28,12 +28,7 @@ export default class CreateAccount extends SolanaCommand { true, ) - // const token = new Token(this.provider.connection, tokenAddress, TOKEN_PROGRAM_ID, { - // publicKey: this.wallet.publicKey, - // secretKey: Buffer.from([]), - // }) - - const accountExists = await isValidTokenAccount(token, associatedAcc) + const accountExists = await isValidTokenAccount(this.provider.connection, tokenAddress, associatedAcc) this.require( !accountExists, `A Token Associated Account to address ${newAccountBase.toString()} already exists: ${associatedAcc}`, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts index 50be63f12..d2ae2f09d 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { logger, prompt, BN } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { createAssociatedTokenAccount, createMint, mintTo } from '@solana/spl-token' import { TOKEN_DECIMALS } from '../../../lib/constants' import { CONTRACT_LIST } from '../../../lib/contracts' @@ -20,30 +20,29 @@ export default class DeployToken extends SolanaCommand { logger.loading('Creating token...') const decimals = this.flags.decimals || TOKEN_DECIMALS - const token = await Token.createMint( + const token = await createMint( this.provider.connection, this.wallet.payer, mintAuthority.publicKey, this.wallet.payer.publicKey, // Freeze authority decimals, - TOKEN_PROGRAM_ID, ) - const billion = new BN(Math.pow(10, 9)) - const tokenVault = await token.createAssociatedTokenAccount(this.wallet.payer.publicKey) - const mintAmount = billion.mul(new BN(Math.pow(10, decimals))) + const billion = BigInt(Math.pow(10, 9)) + const tokenVault = await createAssociatedTokenAccount(this.provider.connection, this.wallet.payer, token, this.wallet.payer.publicKey) + const mintAmount = billion * BigInt(Math.pow(10, decimals)) await prompt( `Minting ${billion.toString()} token units, with ${decimals} decimals. Total ${mintAmount.toString()}. Continue?`, ) - await token.mintTo(tokenVault, this.wallet.payer, [], mintAmount) + await mintTo(this.provider.connection, this.wallet.payer, token, tokenVault, mintAuthority, mintAmount) // To disable minting https://github.com/solana-labs/solana-program-library/blob/36e886392b8c6619b275f6681aed6d8aae6e70f9/token/js/client/token.js#L985 logger.info(` TOKEN: - - Address: ${token.publicKey} + - Address: ${token} VAULT: - address: ${tokenVault.toString()} STATE ACCOUNTS: @@ -54,8 +53,8 @@ export default class DeployToken extends SolanaCommand { return { responses: [ { - tx: { ...this.wrapResponse('', token.publicKey.toString()), wait: async () => ({ success: true }) }, - contract: token.publicKey.toString(), + tx: { ...this.wrapResponse('', token.toString()), wait: async () => ({ success: true }) }, + contract: token.toString(), }, ], } as Result diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/read.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/read.ts index 49e2fc8a1..300aa93d5 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/read.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/read.ts @@ -1,6 +1,6 @@ import { Result } from '@chainlink/gauntlet-core' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { getMint } from '@solana/spl-token' import { PublicKey } from '@solana/web3.js' import { CONTRACT_LIST } from '../../../lib/contracts' @@ -15,9 +15,7 @@ export default class ReadState extends SolanaCommand { execute = async () => { const address = this.args[0] - const tokenClient = new Token(this.provider.connection, new PublicKey(address), TOKEN_PROGRAM_ID, this.wallet.payer) - - const data = await tokenClient.getMintInfo() + const data = await getMint(this.provider.connection, new PublicKey(address)) console.log(data) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts index ffb9e7b29..fff603944 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { ASSOCIATED_TOKEN_PROGRAM_ID, Token, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { ASSOCIATED_TOKEN_PROGRAM_ID, createTransferInstruction, getAssociatedTokenAddress, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { PublicKey, TransactionInstruction } from '@solana/web3.js' import { TOKEN_DECIMALS } from '../../../lib/constants' import { CONTRACT_LIST } from '../../../lib/contracts' @@ -25,37 +25,22 @@ export default class TransferToken extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const address = this.args[0] - const token = new Token(this.provider.connection, new PublicKey(address), TOKEN_PROGRAM_ID, { - publicKey: signer, - secretKey: Buffer.from([]), - }) + const token = new PublicKey(address); - const from = await Token.getAssociatedTokenAddress( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, - token.publicKey, - signer, - true, - ) + const from = await getAssociatedTokenAddress(token, signer, true) const destination = new PublicKey(this.flags.to) - const amount = new BN(this.flags.amount).mul(new BN(10).pow(new BN(TOKEN_DECIMALS))) + const amount = BigInt(this.flags.amount) * (BigInt(10) ** BigInt(TOKEN_DECIMALS)) this.require( - await isValidTokenAccount(token, destination), + await isValidTokenAccount(this.provider.connection, token, destination), `Destination ${destination.toString()} is not a valid token account`, ) logger.info( `Preparing instruction to send ${amount.toString()} (${this.flags.amount}) Tokens to ${destination.toString()}`, ) - const ix = Token.createTransferInstruction( - TOKEN_PROGRAM_ID, - from, - destination, - signer, - [], - amount.toString() as any, - ) + + const ix = createTransferInstruction(from, destination, signer, amount) return [ { diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/utils.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/utils.ts index a033baf16..b6d78335b 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/utils.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/utils.ts @@ -1,10 +1,10 @@ -import { Token } from '@solana/spl-token' -import { PublicKey } from '@solana/web3.js' +import { getAccount } from '@solana/spl-token' +import { Connection, PublicKey } from '@solana/web3.js' -export const isValidTokenAccount = async (token: Token, address: PublicKey) => { +export const isValidTokenAccount = async (connection: Connection, token: PublicKey, address: PublicKey) => { try { - const info = await token.getAccountInfo(address) - return !!info.address + const info = await getAccount(connection, address) + return info.mint == token && !!info.address } catch (e) { return false } From a8147bccaee4431db58ce31d0dd786d4ada215bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 29 Jul 2022 12:46:15 +0900 Subject: [PATCH 29/47] hello-world should use the 1.0 dependency --- contracts/examples/hello-world/Cargo.lock | 6 +++--- .../examples/hello-world/programs/hello-world/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/examples/hello-world/Cargo.lock b/contracts/examples/hello-world/Cargo.lock index 1ac81b799..33acc1401 100644 --- a/contracts/examples/hello-world/Cargo.lock +++ b/contracts/examples/hello-world/Cargo.lock @@ -24,7 +24,7 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.24.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f6ee9518f50ff4d434471ccf569186022bdd5ef65a21d14da3ea5231af944f" dependencies = [ @@ -388,9 +388,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chainlink_solana" -version = "0.1.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e1a6c94acdef947c091751143a1271c433fe140ed045888c0a1248330b1647" +checksum = "a1bc07ff7987366d193e8e1913b4aafcb83f919ad71be8c040b420bcedb6339b" dependencies = [ "borsh", "borsh-derive", diff --git a/contracts/examples/hello-world/programs/hello-world/Cargo.toml b/contracts/examples/hello-world/programs/hello-world/Cargo.toml index 1f2919775..1fd06a701 100644 --- a/contracts/examples/hello-world/programs/hello-world/Cargo.toml +++ b/contracts/examples/hello-world/programs/hello-world/Cargo.toml @@ -17,4 +17,4 @@ default = [] [dependencies] anchor-lang = "0.25.0" -chainlink_solana = "0.1.1" +chainlink_solana = "1.0.0" From c514db36e59ad5ae38a38b866fd54bf6f70423c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 29 Jul 2022 12:48:11 +0900 Subject: [PATCH 30/47] Update solana version in install-solana-ci --- scripts/install-solana-ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-solana-ci.sh b/scripts/install-solana-ci.sh index e01dbc598..34e50ad7b 100755 --- a/scripts/install-solana-ci.sh +++ b/scripts/install-solana-ci.sh @@ -2,5 +2,5 @@ set -euxo pipefail -sh -c "$(curl -sSfL https://release.solana.com/v1.9.12/install)" +sh -c "$(curl -sSfL https://release.solana.com/v1.10.33/install)" echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$PATH" >> $GITHUB_ENV From 7c3c5c0a01edcef49766506866ac2e661e718488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 29 Jul 2022 12:50:34 +0900 Subject: [PATCH 31/47] yarn format --- .../src/commands/contracts/ocr2/fund.ts | 9 ++++++++- .../src/commands/contracts/ocr2/initialize.ts | 16 +++++++++------- .../src/commands/contracts/ocr2/proposePayees.ts | 8 +++++--- .../commands/contracts/token/createAccount.ts | 6 +----- .../src/commands/contracts/token/deploy.ts | 7 ++++++- .../src/commands/contracts/token/transfer.ts | 13 +++++++++---- 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts index 392d68422..3a5d85905 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/fund.ts @@ -36,7 +36,14 @@ export default class Fund extends SolanaCommand { const from = await getAssociatedTokenAddress(linkPublicKey, this.wallet.publicKey) logger.loading(`Transferring ${amount} tokens to ${state.toString()} token vault ${tokenVault.toString()}...`) - const tx = await transfer(this.provider.connection, this.wallet.payer, from, tokenVault, this.wallet.payer, amount.toNumber()) + const tx = await transfer( + this.provider.connection, + this.wallet.payer, + from, + tokenVault, + this.wallet.payer, + amount.toNumber(), + ) return { responses: [ diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index c2429827f..82c7391e2 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -64,13 +64,15 @@ export default class Initialize extends SolanaCommand { const maxAnswer = new BN(input.maxAnswer) const transmissions = new PublicKey(input.transmissions) - const tokenVault = (await getOrCreateAssociatedTokenAccount( - this.provider.connection, - this.wallet.payer, - linkPublicKey, - vaultAuthority, - true, - )).address + const tokenVault = ( + await getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.wallet.payer, + linkPublicKey, + vaultAuthority, + true, + ) + ).address const tx = await program.methods .initialize(minAnswer, maxAnswer) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index aa6b527fb..bb4419c9c 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -112,9 +112,11 @@ export default class ProposePayees extends SolanaCommand { // The length of the payees need to be same as the oracles saved const proposal = new PublicKey(this.input.proposalId) const proposalInfo = (await this.program.account.proposal.fetch(proposal)) as any - const payees = proposalInfo.oracles.xs - .slice(0, proposalInfo.oracles.len) - .map(({ transmitter }) => ({ pubkey: this.contractInput.payeeByTransmitter[transmitter.toString()], isWritable: true, isSigner: false })); + const payees = proposalInfo.oracles.xs.slice(0, proposalInfo.oracles.len).map(({ transmitter }) => ({ + pubkey: this.contractInput.payeeByTransmitter[transmitter.toString()], + isWritable: true, + isSigner: false, + })) const ix = await this.program.methods .proposePayees(link) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts index 6795d33e7..f2e3fb873 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/createAccount.ts @@ -22,11 +22,7 @@ export default class CreateAccount extends SolanaCommand { const tokenAddress = new PublicKey(this.args[0]) const newAccountBase = new PublicKey(this.flags.address) - const associatedAcc = await getAssociatedTokenAddress( - tokenAddress, - newAccountBase, - true, - ) + const associatedAcc = await getAssociatedTokenAddress(tokenAddress, newAccountBase, true) const accountExists = await isValidTokenAccount(this.provider.connection, tokenAddress, associatedAcc) this.require( diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts index d2ae2f09d..3e342bffe 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/deploy.ts @@ -29,7 +29,12 @@ export default class DeployToken extends SolanaCommand { ) const billion = BigInt(Math.pow(10, 9)) - const tokenVault = await createAssociatedTokenAccount(this.provider.connection, this.wallet.payer, token, this.wallet.payer.publicKey) + const tokenVault = await createAssociatedTokenAccount( + this.provider.connection, + this.wallet.payer, + token, + this.wallet.payer.publicKey, + ) const mintAmount = billion * BigInt(Math.pow(10, decimals)) await prompt( diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts index fff603944..e85877a51 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts @@ -1,7 +1,12 @@ import { Result } from '@chainlink/gauntlet-core' import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { ASSOCIATED_TOKEN_PROGRAM_ID, createTransferInstruction, getAssociatedTokenAddress, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { + ASSOCIATED_TOKEN_PROGRAM_ID, + createTransferInstruction, + getAssociatedTokenAddress, + TOKEN_PROGRAM_ID, +} from '@solana/spl-token' import { PublicKey, TransactionInstruction } from '@solana/web3.js' import { TOKEN_DECIMALS } from '../../../lib/constants' import { CONTRACT_LIST } from '../../../lib/contracts' @@ -25,12 +30,12 @@ export default class TransferToken extends SolanaCommand { makeRawTransaction = async (signer: PublicKey) => { const address = this.args[0] - const token = new PublicKey(address); + const token = new PublicKey(address) const from = await getAssociatedTokenAddress(token, signer, true) const destination = new PublicKey(this.flags.to) - const amount = BigInt(this.flags.amount) * (BigInt(10) ** BigInt(TOKEN_DECIMALS)) + const amount = BigInt(this.flags.amount) * BigInt(10) ** BigInt(TOKEN_DECIMALS) this.require( await isValidTokenAccount(this.provider.connection, token, destination), `Destination ${destination.toString()} is not a valid token account`, @@ -39,7 +44,7 @@ export default class TransferToken extends SolanaCommand { logger.info( `Preparing instruction to send ${amount.toString()} (${this.flags.amount}) Tokens to ${destination.toString()}`, ) - + const ix = createTransferInstruction(from, destination, signer, amount) return [ From 1b52e6ea26ce74b79557648693c0173ed84ff1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 29 Jul 2022 15:24:26 +0900 Subject: [PATCH 32/47] Move access controls to context where possible --- .../programs/access-controller/src/lib.rs | 17 +++-------- contracts/programs/ocr2/src/context.rs | 7 +++++ contracts/programs/ocr2/src/lib.rs | 29 +------------------ contracts/programs/store/src/lib.rs | 23 ++++----------- 4 files changed, 17 insertions(+), 59 deletions(-) diff --git a/contracts/programs/access-controller/src/lib.rs b/contracts/programs/access-controller/src/lib.rs index ecc49493a..c02bd37ca 100644 --- a/contracts/programs/access-controller/src/lib.rs +++ b/contracts/programs/access-controller/src/lib.rs @@ -35,7 +35,6 @@ pub mod access_controller { Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.authority))] pub fn transfer_ownership( ctx: Context, proposed_owner: Pubkey, @@ -47,15 +46,10 @@ pub mod access_controller { pub fn accept_ownership(ctx: Context) -> Result<()> { let state = &mut *ctx.accounts.state.load_mut()?; - require!( - ctx.accounts.authority.key == &state.proposed_owner, - Unauthorized - ); state.owner = std::mem::take(&mut state.proposed_owner); Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.owner))] pub fn add_access(ctx: Context) -> Result<()> { let mut state = ctx.accounts.state.load_mut()?; // if the len reaches array len, we're at capacity @@ -72,7 +66,6 @@ pub mod access_controller { Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.owner))] pub fn remove_access(ctx: Context) -> Result<()> { let mut state = ctx.accounts.state.load_mut()?; let address = ctx.accounts.address.key(); @@ -92,12 +85,6 @@ pub fn has_access(loader: &AccountLoader, address: &Pubkey) -> Ok(state.access_list.binary_search(address).is_ok()) } -fn owner(state_loader: &AccountLoader, signer: &AccountInfo) -> Result<()> { - let config = state_loader.load()?; - require!(signer.key.eq(&config.owner), Unauthorized); - Ok(()) -} - #[error_code] pub enum ErrorCode { #[msg("Unauthorized")] @@ -121,6 +108,7 @@ pub struct Initialize<'info> { pub struct TransferOwnership<'info> { #[account(mut)] pub state: AccountLoader<'info, AccessController>, + #[account(address = state.load()?.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -128,6 +116,7 @@ pub struct TransferOwnership<'info> { pub struct AcceptOwnership<'info> { #[account(mut)] pub state: AccountLoader<'info, AccessController>, + #[account(address = state.load()?.proposed_owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -135,6 +124,7 @@ pub struct AcceptOwnership<'info> { pub struct AddAccess<'info> { #[account(mut, has_one = owner)] pub state: AccountLoader<'info, AccessController>, + #[account(address = state.load()?.owner @ ErrorCode::Unauthorized)] pub owner: Signer<'info>, /// CHECK: We don't impose any limits since this could be any signer. pub address: UncheckedAccount<'info>, @@ -144,6 +134,7 @@ pub struct AddAccess<'info> { pub struct RemoveAccess<'info> { #[account(mut, has_one = owner)] pub state: AccountLoader<'info, AccessController>, + #[account(address = state.load()?.owner @ ErrorCode::Unauthorized)] pub owner: Signer<'info>, /// CHECK: We don't impose any limits since this could be any signer. pub address: UncheckedAccount<'info>, diff --git a/contracts/programs/ocr2/src/context.rs b/contracts/programs/ocr2/src/context.rs index b9926e066..71bfc1ebd 100644 --- a/contracts/programs/ocr2/src/context.rs +++ b/contracts/programs/ocr2/src/context.rs @@ -2,6 +2,7 @@ use anchor_lang::prelude::*; use anchor_spl::token::{Mint, Token, TokenAccount, Transfer}; use crate::state::{Proposal, State}; +use crate::ErrorCode; use access_controller::AccessController; use store::{Store, Transmissions}; @@ -42,6 +43,7 @@ pub struct Close<'info> { pub state: AccountLoader<'info, State>, #[account(mut)] pub receiver: SystemAccount<'info>, + #[account(address = state.load()?.config.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, #[account(mut, address = state.load()?.config.token_vault)] @@ -57,6 +59,7 @@ pub struct Close<'info> { pub struct TransferOwnership<'info> { #[account(mut)] pub state: AccountLoader<'info, State>, + #[account(address = state.load()?.config.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -64,6 +67,7 @@ pub struct TransferOwnership<'info> { pub struct AcceptOwnership<'info> { #[account(mut)] pub state: AccountLoader<'info, State>, + #[account(address = state.load()?.config.proposed_owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -80,6 +84,7 @@ pub struct CloseProposal<'info> { pub proposal: AccountLoader<'info, Proposal>, #[account(mut)] pub receiver: SystemAccount<'info>, + #[account(address = proposal.load()?.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -87,6 +92,7 @@ pub struct CloseProposal<'info> { pub struct ProposeConfig<'info> { #[account(mut)] pub proposal: AccountLoader<'info, Proposal>, + #[account(address = proposal.load()?.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -98,6 +104,7 @@ pub struct AcceptProposal<'info> { pub proposal: AccountLoader<'info, Proposal>, #[account(mut)] pub receiver: SystemAccount<'info>, + #[account(address = state.load()?.config.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, #[account(mut, address = state.load()?.config.token_vault)] diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 422e1e1b6..566a62bfd 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -51,7 +51,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.authority))] pub fn close<'info>(ctx: Context<'_, '_, '_, 'info, Close<'info>>) -> Result<()> { // Pay out any remaining balances pay_oracles_impl( @@ -66,7 +65,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.authority))] pub fn transfer_ownership( ctx: Context, proposed_owner: Pubkey, @@ -78,10 +76,6 @@ pub mod ocr2 { pub fn accept_ownership(ctx: Context) -> Result<()> { let mut state = ctx.accounts.state.load_mut()?; - require!( - ctx.accounts.authority.key == &state.config.proposed_owner, - Unauthorized - ); state.config.owner = std::mem::take(&mut state.config.proposed_owner); Ok(()) } @@ -100,7 +94,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(proposal_owner(&ctx.accounts.proposal, &ctx.accounts.authority))] pub fn write_offchain_config( ctx: Context, offchain_config: Vec, @@ -116,7 +109,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(proposal_owner(&ctx.accounts.proposal, &ctx.accounts.authority))] pub fn finalize_proposal(ctx: Context) -> Result<()> { let mut proposal = ctx.accounts.proposal.load_mut()?; require!(proposal.state != Proposal::FINALIZED, InvalidInput); @@ -138,13 +130,11 @@ pub mod ocr2 { Ok(()) } - #[access_control(proposal_owner(&ctx.accounts.proposal, &ctx.accounts.authority))] - pub fn close_proposal(ctx: Context) -> Result<()> { + pub fn close_proposal(_ctx: Context) -> Result<()> { // NOTE: Close is handled by anchor on exit due to the `close` attribute Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.authority))] pub fn accept_proposal<'info>( ctx: Context<'_, '_, '_, 'info, AcceptProposal<'info>>, digest: Vec, @@ -223,7 +213,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(proposal_owner(&ctx.accounts.proposal, &ctx.accounts.authority))] pub fn propose_config( ctx: Context, new_oracles: Vec, @@ -276,7 +265,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(proposal_owner(&ctx.accounts.proposal, &ctx.accounts.authority))] pub fn propose_payees(ctx: Context, token_mint: Pubkey) -> Result<()> { let mut proposal = ctx.accounts.proposal.load_mut()?; require!(proposal.state != Proposal::FINALIZED, InvalidInput); @@ -300,7 +288,6 @@ pub mod ocr2 { Ok(()) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.authority))] pub fn set_requester_access_controller(ctx: Context) -> Result<()> { let mut state = ctx.accounts.state.load_mut()?; state.config.requester_access_controller = ctx.accounts.access_controller.key(); @@ -351,7 +338,6 @@ pub mod ocr2 { accounts.exit(program_id) } - #[access_control(owner(&ctx.accounts.state, &ctx.accounts.authority))] pub fn set_billing_access_controller(ctx: Context) -> Result<()> { let mut state = ctx.accounts.state.load_mut()?; state.config.billing_access_controller = ctx.accounts.access_controller.key(); @@ -832,19 +818,6 @@ fn calculate_total_link_due_gjuels(config: &Config, oracles: &[Oracle]) -> Resul // -- Access control modifiers -// Only owner access -fn owner(state_loader: &AccountLoader, signer: &AccountInfo) -> Result<()> { - let config = state_loader.load()?.config; - require!(signer.key.eq(&config.owner), Unauthorized); - Ok(()) -} - -fn proposal_owner(proposal_loader: &AccountLoader, signer: &AccountInfo) -> Result<()> { - let proposal = proposal_loader.load()?; - require!(signer.key.eq(&proposal.owner), Unauthorized); - Ok(()) -} - fn has_billing_access( state: &AccountLoader, controller: &AccountLoader, diff --git a/contracts/programs/store/src/lib.rs b/contracts/programs/store/src/lib.rs index 7a2a8874b..749611caf 100644 --- a/contracts/programs/store/src/lib.rs +++ b/contracts/programs/store/src/lib.rs @@ -148,12 +148,6 @@ pub mod store { } pub fn submit(ctx: Context, round: NewTransmission) -> Result<()> { - // check if this particular ocr2 cluster is allowed to write to the feed - require!( - ctx.accounts.authority.key == &ctx.accounts.feed.writer, - Unauthorized - ); - let clock = Clock::get()?; let round = Transmission { slot: clock.slot, @@ -193,7 +187,6 @@ pub mod store { Ok(()) } - #[access_control(store_owner(&ctx.accounts.store, &ctx.accounts.authority))] pub fn transfer_store_ownership( ctx: Context, proposed_owner: Pubkey, @@ -205,15 +198,10 @@ pub mod store { pub fn accept_store_ownership(ctx: Context) -> Result<()> { let store = &mut *ctx.accounts.store.load_mut()?; - require!( - ctx.accounts.authority.key == &store.proposed_owner, - Unauthorized - ); store.owner = std::mem::take(&mut store.proposed_owner); Ok(()) } - #[access_control(store_owner(&ctx.accounts.store, &ctx.accounts.authority))] pub fn set_lowering_access_controller(ctx: Context) -> Result<()> { let mut store = ctx.accounts.store.load_mut()?; store.lowering_access_controller = ctx.accounts.access_controller.key(); @@ -326,12 +314,6 @@ fn owner<'info>(owner: &UncheckedAccount<'info>, authority: &Signer) -> Result<( Ok(()) } -fn store_owner(store_loader: &AccountLoader, signer: &AccountInfo) -> Result<()> { - let store = store_loader.load()?; - require!(signer.key.eq(&store.owner), Unauthorized); - Ok(()) -} - fn has_lowering_access( owner: &UncheckedAccount, controller: &UncheckedAccount, @@ -518,6 +500,8 @@ pub struct Submit<'info> { /// The OCR2 feed #[account(mut)] pub feed: Account<'info, Transmissions>, + // check if this particular ocr2 cluster is allowed to write to the feed + #[account(address = feed.writer @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -535,6 +519,7 @@ pub struct Initialize<'info> { pub struct TransferStoreOwnership<'info> { #[account(mut)] pub store: AccountLoader<'info, State>, + #[account(address = store.load()?.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -542,6 +527,7 @@ pub struct TransferStoreOwnership<'info> { pub struct AcceptStoreOwnership<'info> { #[account(mut)] pub store: AccountLoader<'info, State>, + #[account(address = store.load()?.proposed_owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, } @@ -549,6 +535,7 @@ pub struct AcceptStoreOwnership<'info> { pub struct SetAccessController<'info> { #[account(mut)] pub store: AccountLoader<'info, State>, + #[account(address = store.load()?.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, pub access_controller: AccountLoader<'info, AccessController>, } From 5c18ab773d03d1cdafc59d53a5feca00565ccc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 29 Jul 2022 15:29:27 +0900 Subject: [PATCH 33/47] Misc fixes --- contracts/programs/ocr2/src/lib.rs | 17 ++++++++++------- contracts/programs/ocr2/src/state.rs | 6 +++++- contracts/programs/store/src/state.rs | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 566a62bfd..c1012742b 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -2,7 +2,7 @@ use anchor_lang::prelude::*; use anchor_spl::token; use arrayref::{array_ref, array_refs}; -use state::{Billing, Proposal, ProposedOracle}; +use state::{Billing, Proposal, ProposedOracle, STATE_VERSION}; declare_id!("cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ"); @@ -31,7 +31,7 @@ pub mod ocr2 { use super::*; pub fn initialize(ctx: Context, min_answer: i128, max_answer: i128) -> Result<()> { let mut state = ctx.accounts.state.load_init()?; - state.version = 1; + state.version = STATE_VERSION; state.vault_nonce = *ctx.bumps.get("vault_authority").unwrap(); state.feed = ctx.accounts.feed.key(); @@ -86,7 +86,7 @@ pub mod ocr2 { ) -> Result<()> { let mut proposal = ctx.accounts.proposal.load_init()?; - proposal.version = 1; + proposal.version = STATE_VERSION; proposal.owner = ctx.accounts.authority.key(); require!(offchain_config_version != 0, InvalidInput); @@ -113,12 +113,12 @@ pub mod ocr2 { let mut proposal = ctx.accounts.proposal.load_mut()?; require!(proposal.state != Proposal::FINALIZED, InvalidInput); - // Require that at least some data was written via setOffchainConfig + // Require that at least some data was written via write_offchain_config require!(proposal.offchain_config.version > 0, InvalidInput); require!(!proposal.offchain_config.is_empty(), InvalidInput); - // setConfig must have been called + // propose_config must have been called require!(!proposal.oracles.is_empty(), InvalidInput); - // setPayees must have been called + // propose_payees must have been called let valid_payees = proposal .oracles .iter() @@ -153,6 +153,9 @@ pub mod ocr2 { let mut state = ctx.accounts.state.load_mut()?; let proposal = ctx.accounts.proposal.load()?; + // State version should equal proposal version + require!(state.version == proposal.version, InvalidInput); + // Proposal has to be finalized require!(proposal.state == Proposal::FINALIZED, InvalidInput); // Digest has to match @@ -735,7 +738,7 @@ struct Report { } impl Report { - // (uint32, u8, bytes32, int128, uint128) + // (uint32, u8, bytes32, int128, u64) pub const LEN: usize = size_of::() + size_of::() + 32 + size_of::() + size_of::(); diff --git a/contracts/programs/ocr2/src/state.rs b/contracts/programs/ocr2/src/state.rs index cb524ebf8..5a6911bab 100644 --- a/contracts/programs/ocr2/src/state.rs +++ b/contracts/programs/ocr2/src/state.rs @@ -16,6 +16,10 @@ const_assert!(MAX_ORACLES <= 31); #[constant] pub const DIGEST_SIZE: usize = 32; +pub const ONCHAIN_CONFIG_VERSION: u8 = 1; + +pub const STATE_VERSION: u8 = 1; + #[zero_copy] pub struct Billing { pub observation_payment_gjuels: u32, @@ -146,7 +150,7 @@ impl Config { oracles: &[Oracle], ) -> [u8; DIGEST_SIZE] { // calculate onchain_config from stored config - let mut onchain_config = vec![1]; // version + let mut onchain_config = vec![ONCHAIN_CONFIG_VERSION]; // version // the ocr plugin expects i192 encoded values, so we need to sign extend to make the digest match if self.min_answer.is_negative() { diff --git a/contracts/programs/store/src/state.rs b/contracts/programs/store/src/state.rs index 2b7106366..f8ad62f18 100644 --- a/contracts/programs/store/src/state.rs +++ b/contracts/programs/store/src/state.rs @@ -131,7 +131,7 @@ impl<'a> Feed<'a> { let len = self.header.live_length; // Handle wraparound - let i = (self.header.live_cursor + len.saturating_sub(1)) % len; + let i = (self.header.live_cursor + len - 1) % len; Some(self.live[i as usize]) } From 64ee9530452365c069c44c1480d67b4fc33c8fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 1 Aug 2022 14:42:48 +0900 Subject: [PATCH 34/47] fix: Transfer any remaining token_vault balance on close() --- contracts/programs/ocr2/src/context.rs | 4 +++ contracts/programs/ocr2/src/lib.rs | 19 +++++++++++++ contracts/tests/ocr2.spec.ts | 28 +++++++++++-------- .../src/commands/contracts/ocr2/close.ts | 11 +++++++- 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/contracts/programs/ocr2/src/context.rs b/contracts/programs/ocr2/src/context.rs index 71bfc1ebd..048cded12 100644 --- a/contracts/programs/ocr2/src/context.rs +++ b/contracts/programs/ocr2/src/context.rs @@ -41,8 +41,12 @@ pub struct Initialize<'info> { pub struct Close<'info> { #[account(mut, close = receiver)] pub state: AccountLoader<'info, State>, + // Receives the SOL deposit #[account(mut)] pub receiver: SystemAccount<'info>, + // Receives the remaining LINK amount + #[account(mut, token::mint = state.load()?.config.token_mint)] + pub token_receiver: Account<'info, TokenAccount>, #[account(address = state.load()?.config.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index c1012742b..febc9231c 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -61,6 +61,25 @@ pub mod ocr2 { ctx.remaining_accounts, )?; + // Transfer out remaining balance from the token_vault + let balance_gjuels = token::accessor::amount(&ctx.accounts.token_vault.to_account_info())?; + token::transfer( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + token::Transfer { + from: ctx.accounts.token_vault.to_account_info(), + to: ctx.accounts.token_receiver.to_account_info(), + authority: ctx.accounts.vault_authority.to_account_info(), + }, + ) + .with_signer(&[&[ + b"vault".as_ref(), + ctx.accounts.state.key().as_ref(), + &[ctx.accounts.state.load()?.vault_nonce], + ]]), + balance_gjuels, + )?; + // NOTE: Close is handled by anchor on exit due to the `close` attribute Ok(()) } diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 8dfddd880..7457eac8a 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -2,11 +2,9 @@ import * as anchor from "@project-serum/anchor"; import { ProgramError, BN } from "@project-serum/anchor"; import * as borsh from "borsh"; import { - SYSVAR_RENT_PUBKEY, LAMPORTS_PER_SOL, PublicKey, Keypair, - SystemProgram, Transaction, TransactionInstruction, } from "@solana/web3.js"; @@ -16,8 +14,6 @@ import { mintTo, getAccount, getOrCreateAssociatedTokenAccount, - getAssociatedTokenAddress, - ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from "@solana/spl-token"; import { assert } from "chai"; @@ -75,8 +71,6 @@ describe("ocr2", async () => { const owner = provider.wallet; const mintAuthority = Keypair.generate(); - const placeholder = Keypair.generate().publicKey; - const decimals = 18; const description = "ETH/BTC"; @@ -341,7 +335,6 @@ describe("ocr2", async () => { console.log("tokenMint", token.toBase58()); console.log("tokenVault", tokenVault.toBase58()); console.log("vaultAuthority", vaultAuthority.toBase58()); - console.log("placeholder", placeholder.toBase58()); const granularity = 30; const liveLength = 3; @@ -783,6 +776,7 @@ describe("ocr2", async () => { }); it("Withdraws funds", async () => { + const placeholder = Keypair.generate().publicKey; const recipient = await createAccount( provider.connection, fromWallet, @@ -977,6 +971,8 @@ describe("ocr2", async () => { // Retrieved rent exemption sol. assert.ok(afterBalance > beforeBalance); + // TODO: also verify tokenVault got drained + const closedAccount = await provider.connection.getAccountInfo( feed.publicKey ); @@ -984,10 +980,6 @@ describe("ocr2", async () => { }); it("Reclaims rent exempt deposit when closing down an aggregator", async () => { - let beforeBalance = ( - await provider.connection.getAccountInfo(provider.wallet.publicKey) - ).lamports; - // fetch payees let account = await program.account.state.fetch(state.publicKey); let currentOracles = account.oracles.xs.slice(0, account.oracles.len); @@ -995,10 +987,24 @@ describe("ocr2", async () => { return { pubkey: oracle.payee, isWritable: true, isSigner: false }; }); + // TODO: it complains account is off curve + let recipientTokenAccount = await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, + provider.wallet.publicKey, + true + ); + + let beforeBalance = ( + await provider.connection.getAccountInfo(provider.wallet.publicKey) + ).lamports; + await program.rpc.close({ accounts: { state: state.publicKey, receiver: provider.wallet.publicKey, + tokenReceiver: recipientTokenAccount.address, authority: owner.publicKey, tokenVault: tokenVault, vaultAuthority: vaultAuthority, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts index f02635def..424b5fd64 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts @@ -1,4 +1,4 @@ -import { TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { utils } from '@project-serum/anchor' import { PublicKey } from '@solana/web3.js' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' @@ -21,6 +21,14 @@ export default class extends Close { const program = this.loadProgram(contract.idl, contract.programId.toString()) const address = new PublicKey(this.args[0]) + const linkPublicKey = new PublicKey(this.flags.link || process.env.LINK) + const tokenRecipient = await getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.wallet.payer, + linkPublicKey, + this.provider.wallet.publicKey, + true + ); const { config, oracles } = (await program.account.state.fetch(address)) as any const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), address.toBuffer()], @@ -32,6 +40,7 @@ export default class extends Close { .map((oracle) => ({ pubkey: oracle.payee, isWritable: true, isSigner: false })) const extraAccounts = { + tokenRecipient, tokenVault: config.tokenVault, vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, From 86a4b772f1b8d1d8bacc3f9971c1413b81699608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 5 Aug 2022 14:16:23 +0900 Subject: [PATCH 35/47] Add a test for feeds with zero-sized historical buffer --- contracts/tests/ocr2.spec.ts | 404 +++++++++++++++++++++++------------ 1 file changed, 268 insertions(+), 136 deletions(-) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 7457eac8a..3b2352cac 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -14,7 +14,7 @@ import { mintTo, getAccount, getOrCreateAssociatedTokenAccount, - TOKEN_PROGRAM_ID + TOKEN_PROGRAM_ID, } from "@solana/spl-token"; import { assert } from "chai"; @@ -54,7 +54,7 @@ describe("ocr2", async () => { // Generate a new wallet keypair and airdrop SOL const fromWallet = Keypair.generate(); - + const billingAccessController = Keypair.generate(); const requesterAccessController = Keypair.generate(); const store = Keypair.generate(); @@ -102,8 +102,9 @@ describe("ocr2", async () => { accounts: { feed }, options: { commitment: "confirmed" }, }); - // await provider.connection.confirmTransaction(tx); - let t = await provider.connection.getConfirmedTransaction(tx, "confirmed"); + let t = await provider.connection.getTransaction(tx, { + commitment: "confirmed", + }); // "Program return: " const prefix = "Program return: "; @@ -119,10 +120,11 @@ describe("ocr2", async () => { // transmits a single round let transmit = async ( + feed: PublicKey, epoch: number, round: number, answer: BN, - juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]), // juels per lamport (2) + juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]) // juels per lamport (2) ): Promise => { let account = await program.account.state.fetch(state.publicKey); @@ -205,7 +207,7 @@ describe("ocr2", async () => { { pubkey: state.publicKey, isWritable: true, isSigner: false }, { pubkey: transmitter.publicKey, isWritable: false, isSigner: true }, { - pubkey: feed.publicKey, + pubkey: feed, isWritable: true, isSigner: false, }, @@ -239,8 +241,11 @@ describe("ocr2", async () => { }; it("Funds the payer", async () => { - await provider.connection.requestAirdrop(fromWallet.publicKey, LAMPORTS_PER_SOL); - + await provider.connection.requestAirdrop( + fromWallet.publicKey, + LAMPORTS_PER_SOL + ); + await provider.connection.confirmTransaction( await provider.connection.requestAirdrop(payer.publicKey, 10000000000), "confirmed" @@ -253,7 +258,7 @@ describe("ocr2", async () => { payer, mintAuthority.publicKey, null, - 9, // SPL tokens use a u64, we can fit enough total supply in 9 decimals. Smallest unit is Gjuels + 9 // SPL tokens use a u64, we can fit enough total supply in 9 decimals. Smallest unit is Gjuels ); // tokenClient = new Token( @@ -316,13 +321,15 @@ describe("ocr2", async () => { ); // Create an associated token account for LINK, owned by the program instance - tokenVault = (await getOrCreateAssociatedTokenAccount( - provider.connection, - fromWallet, - token, - vaultAuthority, - true // allowOwnerOffCurve: seems required since a PDA isn't a valid keypair - )).address; + tokenVault = ( + await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, + vaultAuthority, + true // allowOwnerOffCurve: seems required since a PDA isn't a valid keypair + ) + ).address; }); it("Initializes the OCR2 feed", async () => { @@ -338,28 +345,32 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; - await workspace.Store.methods.createFeed( - description, - decimals, - granularity, - liveLength - ).accounts({ - feed: feed.publicKey, - authority: owner.publicKey, - }).signers([feed]).preInstructions([ - await workspace.Store.account.transmissions.createInstruction( - feed, - 8 + 192 + 6 * 48 - ), - ]).rpc(); + await workspace.Store.methods + .createFeed(description, decimals, granularity, liveLength) + .accounts({ + feed: feed.publicKey, + authority: owner.publicKey, + }) + .signers([feed]) + .preInstructions([ + await workspace.Store.account.transmissions.createInstruction( + feed, + 8 + 192 + 6 * 48 + ), + ]) + .rpc(); // Program log: panicked at 'range end index 8 out of range for slice of length 0', store/src/lib.rs:476:10 // Configure threshold for the feed - await workspace.Store.methods.setValidatorConfig(flaggingThreshold).accounts({ - feed: feed.publicKey, - owner: owner.publicKey, - authority: owner.publicKey, - }).signers([]).rpc(); + await workspace.Store.methods + .setValidatorConfig(flaggingThreshold) + .accounts({ + feed: feed.publicKey, + owner: owner.publicKey, + authority: owner.publicKey, + }) + .signers([]) + .rpc(); // store authority for our ocr2 config [storeAuthority, storeNonce] = await PublicKey.findProgramAddress( @@ -415,63 +426,26 @@ describe("ocr2", async () => { // } // }); - it("Initializes the OCR2 config", async () => { - await (program.methods.initialize( - new BN(minAnswer), - new BN(maxAnswer), - ).accounts({ - state: state.publicKey, - feed: feed.publicKey, - // payer: provider.wallet.publicKey, - owner: owner.publicKey, - tokenMint: token, - tokenVault: tokenVault, - vaultAuthority: vaultAuthority, - requesterAccessController: requesterAccessController.publicKey, - billingAccessController: billingAccessController.publicKey, - // rent: SYSVAR_RENT_PUBKEY, - // systemProgram: SystemProgram.programId, - // tokenProgram: TOKEN_PROGRAM_ID, - // associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, - }) - .signers([state]) - .preInstructions([ - await program.account.state.createInstruction(state) - // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), - // createFeed, - ]).rpc()); - - let account = await program.account.state.fetch(state.publicKey); - let config = account.config; - assert.ok(config.minAnswer.toNumber() == minAnswer); - assert.ok(config.maxAnswer.toNumber() == maxAnswer); - // assert.ok(config.decimals == 18); - - console.log(`Generating ${n} oracles...`); - let futures = []; - let generateOracle = async () => { - let secretKey = randomBytes(32); - let transmitter = Keypair.generate(); - return { - signer: { - secretKey, - publicKey: secp256k1.publicKeyCreate(secretKey, false).slice(1), // compressed = false, skip first byte (0x04) - }, - transmitter, - // Initialize a token account - payee: await getOrCreateAssociatedTokenAccount( - provider.connection, - fromWallet, - token, - transmitter.publicKey - ), - }; + let generateOracle = async () => { + let secretKey = randomBytes(32); + let transmitter = Keypair.generate(); + return { + signer: { + secretKey, + publicKey: secp256k1.publicKeyCreate(secretKey, false).slice(1), // compressed = false, skip first byte (0x04) + }, + transmitter, + // Initialize a token account + payee: await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, + transmitter.publicKey + ), }; - for (let i = 0; i < n; i++) { - futures.push(generateOracle()); - } - oracles = await Promise.all(futures); + }; + let configure = async () => { const offchain_config_version = 2; const offchain_config = Buffer.from([4, 5, 6]); @@ -483,7 +457,7 @@ describe("ocr2", async () => { tokenVault, mintAuthority.publicKey, 100000000000000, - [mintAuthority], + [mintAuthority] ); // TODO: listen for SetConfig event @@ -532,9 +506,14 @@ describe("ocr2", async () => { console.log("proposePayees"); let payees = oracles.map((oracle) => { - return { pubkey: oracle.payee.address, isWritable: true, isSigner: false }; + return { + pubkey: oracle.payee.address, + isWritable: true, + isSigner: false, + }; }); - await program.methods.proposePayees(token) + await program.methods + .proposePayees(token) .accounts({ proposal: proposal.publicKey, authority: owner.publicKey, @@ -543,7 +522,8 @@ describe("ocr2", async () => { .rpc(); console.log("finalizeProposal"); - await program.methods.finalizeProposal() + await program.methods + .finalizeProposal() .accounts({ proposal: proposal.publicKey, authority: owner.publicKey, @@ -551,22 +531,35 @@ describe("ocr2", async () => { .rpc(); // compute proposal digest - let proposalAccount = await program.account.proposal.fetch(proposal.publicKey); + let proposalAccount = await program.account.proposal.fetch( + proposal.publicKey + ); console.log(proposalAccount); - let proposalOracles = proposalAccount.oracles.xs.slice(0, proposalAccount.oracles.len); - let proposalOC = proposalAccount.offchainConfig.xs.slice(0, proposalAccount.offchainConfig.len); + let proposalOracles = proposalAccount.oracles.xs.slice( + 0, + proposalAccount.oracles.len + ); + let proposalOC = proposalAccount.offchainConfig.xs.slice( + 0, + proposalAccount.offchainConfig.len + ); - let hasher = createHash("sha256").update(Buffer.from([proposalAccount.oracles.len])); + let hasher = createHash("sha256").update( + Buffer.from([proposalAccount.oracles.len]) + ); hasher = proposalOracles.reduce((hasher, oracle) => { return hasher .update(Buffer.from(oracle.signer.key)) .update(oracle.transmitter.toBuffer()) - .update(oracle.payee.toBuffer()) + .update(oracle.payee.toBuffer()); }, hasher); - let offchainConfigHeader = Buffer.alloc(8+4); - offchainConfigHeader.writeBigUInt64BE(BigInt(proposalAccount.offchainConfig.version), 0); + let offchainConfigHeader = Buffer.alloc(8 + 4); + offchainConfigHeader.writeBigUInt64BE( + BigInt(proposalAccount.offchainConfig.version), + 0 + ); offchainConfigHeader.writeUInt32BE(proposalAccount.offchainConfig.len, 8); let digest = hasher @@ -577,7 +570,7 @@ describe("ocr2", async () => { .digest(); // fetch payees - account = await program.account.state.fetch(state.publicKey); + let account = await program.account.state.fetch(state.publicKey); let currentOracles = account.oracles.xs.slice(0, account.oracles.len); payees = currentOracles.map((oracle) => { return { pubkey: oracle.payee, isWritable: true, isSigner: false }; @@ -596,6 +589,48 @@ describe("ocr2", async () => { }, remainingAccounts: payees, }); + }; + + it("Initializes the OCR2 config", async () => { + await program.methods + .initialize(new BN(minAnswer), new BN(maxAnswer)) + .accounts({ + state: state.publicKey, + feed: feed.publicKey, + // payer: provider.wallet.publicKey, + owner: owner.publicKey, + tokenMint: token, + tokenVault: tokenVault, + vaultAuthority: vaultAuthority, + requesterAccessController: requesterAccessController.publicKey, + billingAccessController: billingAccessController.publicKey, + // rent: SYSVAR_RENT_PUBKEY, + // systemProgram: SystemProgram.programId, + // tokenProgram: TOKEN_PROGRAM_ID, + // associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, + }) + .signers([state]) + .preInstructions([ + await program.account.state.createInstruction(state), + // await store.account.transmissions.createInstruction(transmissions, 8+192+8096*24), + // createFeed, + ]) + .rpc(); + + let account = await program.account.state.fetch(state.publicKey); + let config = account.config; + assert.ok(config.minAnswer.toNumber() == minAnswer); + assert.ok(config.maxAnswer.toNumber() == maxAnswer); + // assert.ok(config.decimals == 18); + + console.log(`Generating ${n} oracles...`); + let futures = []; + for (let i = 0; i < n; i++) { + futures.push(generateOracle()); + } + oracles = await Promise.all(futures); + + await configure(); // TODO: validate that payees were paid @@ -621,8 +656,8 @@ describe("ocr2", async () => { // fetch payees account = await program.account.state.fetch(state.publicKey); - currentOracles = account.oracles.xs.slice(0, account.oracles.len); - payees = currentOracles.map((oracle) => { + let currentOracles = account.oracles.xs.slice(0, account.oracles.len); + let payees = currentOracles.map((oracle) => { return { pubkey: oracle.payee, isWritable: true, isSigner: false }; }); @@ -733,7 +768,7 @@ describe("ocr2", async () => { it("Can't transmit a round if not the writer", async () => { try { - await transmit(1, 1, new BN(1)); + await transmit(feed.publicKey, 1, 1, new BN(1)); } catch { // transmit should fail return; @@ -772,7 +807,7 @@ describe("ocr2", async () => { }); it("Transmits a round", async () => { - await transmit(1, 2, new BN(3)); + await transmit(feed.publicKey, 1, 2, new BN(3)); }); it("Withdraws funds", async () => { @@ -781,7 +816,8 @@ describe("ocr2", async () => { provider.connection, fromWallet, token, - placeholder); + placeholder + ); // TODO: it complains account is off curve let recipientTokenAccount = await getOrCreateAssociatedTokenAccount( provider.connection, @@ -841,12 +877,7 @@ describe("ocr2", async () => { const versionSchema = new Map([ [Round, { kind: "struct", fields: [["version", "u8"]] }], ]); - let data = await query( - feed.publicKey, - Scope.Version, - versionSchema, - Round - ); + let data = await query(feed.publicKey, Scope.Version, versionSchema, Round); assert.ok(data.version == 2); const descriptionSchema = new Map([ @@ -863,7 +894,7 @@ describe("ocr2", async () => { it("Transmit a bunch of rounds to check ringbuffer wraparound", async () => { for (let i = 2; i <= rounds; i++) { - let transmitTx = await transmit(i, i, new BN(i)); + let transmitTx = await transmit(feed.publicKey, i, i, new BN(i)); await provider.connection.confirmTransaction(transmitTx); let t = await provider.connection.getTransaction(transmitTx, { @@ -881,7 +912,7 @@ describe("ocr2", async () => { } }); - it ("Node payouts happen with the correct decimals", async () => { + it("Node payouts happen with the correct decimals", async () => { // fetch payees let account = await program.account.state.fetch(state.publicKey); let currentOracles = account.oracles.xs.slice(0, account.oracles.len); @@ -892,7 +923,10 @@ describe("ocr2", async () => { // + 2 juels per lamport => rounded to 0 // + 1 gjuel // = 1 gjuel - assert.equal(transmissionPayment*rounds, oracle.paymentGjuels.toNumber()) + assert.equal( + transmissionPayment * rounds, + oracle.paymentGjuels.toNumber() + ); transmitter = oracle.payee; } return { pubkey: oracle.payee, isWritable: true, isSigner: false }; @@ -911,44 +945,58 @@ describe("ocr2", async () => { }); for (let i = 0; i < payees.length; i++) { - const account = await getAccount(provider.connection, payees[i].pubkey) + const account = await getAccount(provider.connection, payees[i].pubkey); if (payees[i].pubkey.equals(transmitter)) { // transmitter + observation payment - assert.equal(BigInt((observationPayment+transmissionPayment)*rounds), account.amount) + assert.equal( + BigInt((observationPayment + transmissionPayment) * rounds), + account.amount + ); continue; } // observation payment - assert.equal(BigInt(observationPayment*rounds), account.amount) + assert.equal(BigInt(observationPayment * rounds), account.amount); } - }); it("Transmit does not fail on juelsPerFeecoin edge cases", async () => { // zero value u64 juelsPerFeecoin - await transmit(rounds+1, rounds+1, new BN(rounds+1), Buffer.from([0, 0, 0, 0, 0, 0, 0, 0])); + await transmit( + feed.publicKey, + rounds + 1, + rounds + 1, + new BN(rounds + 1), + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]) + ); // max value u64 juelsPerFeecoin - await transmit(rounds+2, rounds+2, new BN(rounds+2), Buffer.from([127, 127, 127, 127, 127, 127, 127, 127])); - }) + await transmit( + feed.publicKey, + rounds + 2, + rounds + 2, + new BN(rounds + 2), + Buffer.from([127, 127, 127, 127, 127, 127, 127, 127]) + ); + }); it("TS client listens and parses state", async () => { - let feed = new OCR2Feed(program, provider); + let stream = new OCR2Feed(program, provider); let listener = null; let success = new Promise((resolve, _reject) => { - listener = feed.onRound(state.publicKey, (event) => { - resolve(event) + listener = stream.onRound(state.publicKey, (event) => { + resolve(event); }); }); - let transmitTx = transmit(100, 1, new BN(16)); - + let transmitTx = transmit(feed.publicKey, 100, 1, new BN(16)); + let event = await success; - assert.ok(event.feed.equals(state.publicKey)) - assert.equal(event.answer.toNumber(), 16) + assert.ok(event.feed.equals(state.publicKey)); + assert.equal(event.answer.toNumber(), 16); - await feed.removeListener(listener); - }) + await stream.removeListener(listener); + }); it("Reclaims rent exempt deposit when closing down a feed", async () => { let beforeBalance = ( @@ -1030,13 +1078,13 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; - const header = 8 + 192 // account discriminator + header - const transmissionSize = 48 + const header = 8 + 192; // account discriminator + header + const transmissionSize = 48; const invalidLengths = [ header - 1, // insufficient for header size header + 6 * transmissionSize - 1, // incorrect size for ring buffer header + 2 * transmissionSize, // live length exceeds total capacity - ] + ]; for (let i = 0; i < invalidLengths.length; i++) { try { const invalidFeed = Keypair.generate(); @@ -1062,8 +1110,92 @@ describe("ocr2", async () => { } catch { continue; // expect error } - assert.fail(`create feed shouldn't have succeeded with account size ${invalidLengths[i]}`); + assert.fail( + `create feed shouldn't have succeeded with account size ${invalidLengths[i]}` + ); } }); + it("Can create a feed with no historical ringbuffer", async () => { + const granularity = 1; + const liveLength = 3; + + const header = 8 + 192; // account discriminator + header + const transmissionSize = 48; + const feed = Keypair.generate(); + const length = header + transmissionSize * liveLength; + + // Create the feed account + await workspace.Store.rpc.createFeed( + description, + decimals, + granularity, + liveLength, + { + accounts: { + feed: feed.publicKey, + authority: owner.publicKey, + }, + signers: [feed], + preInstructions: [ + await workspace.Store.account.transmissions.createInstruction( + feed, + length + ), + ], + } + ); + + // Create the aggregator account + await program.methods + .initialize(new BN(minAnswer), new BN(maxAnswer)) + .accounts({ + state: state.publicKey, + feed: feed.publicKey, + owner: owner.publicKey, + tokenMint: token, + tokenVault: tokenVault, + vaultAuthority: vaultAuthority, + requesterAccessController: requesterAccessController.publicKey, + billingAccessController: billingAccessController.publicKey, + }) + .signers([state]) + .preInstructions([await program.account.state.createInstruction(state)]) + .rpc(); + + console.log(`Generating ${n} oracles...`); + let futures = []; + for (let i = 0; i < n; i++) { + futures.push(generateOracle()); + } + oracles = await Promise.all(futures); + + // Configure the aggregator + await configure(); + + // Set feed writer + await workspace.Store.rpc.setWriter(storeAuthority, { + accounts: { + feed: feed.publicKey, + owner: owner.publicKey, + authority: owner.publicKey, + }, + }); + + // submit, then read from the feed to ensure it works fine + let transmitTx = await transmit(feed.publicKey, 1, 1, new BN(100)); + await provider.connection.confirmTransaction(transmitTx); + let t = await provider.connection.getTransaction(transmitTx, { + commitment: "confirmed", + }); + console.log(t.meta.logMessages); + + let round = await query( + feed.publicKey, + Scope.LatestRoundData, + roundSchema, + Round + ); + assert.equal(new BN(round.answer, 10, "le").toNumber(), 100); + }); }); From 89c6279d589738a37f1eda3a7b3a31ff768c4e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 5 Aug 2022 14:22:06 +0900 Subject: [PATCH 36/47] fix gauntlet close command --- .../src/commands/contracts/ocr2/close.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts index 424b5fd64..cd3d36c12 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts @@ -40,7 +40,7 @@ export default class extends Close { .map((oracle) => ({ pubkey: oracle.payee, isWritable: true, isSigner: false })) const extraAccounts = { - tokenRecipient, + tokenRecipient: tokenRecipient.address, tokenVault: config.tokenVault, vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, From 789169851da15fc7533b0491d0255fbf6ad13948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 5 Aug 2022 14:22:43 +0900 Subject: [PATCH 37/47] yarn format --- .../src/commands/contracts/ocr2/close.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts index cd3d36c12..8192ee197 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/close.ts @@ -27,8 +27,8 @@ export default class extends Close { this.wallet.payer, linkPublicKey, this.provider.wallet.publicKey, - true - ); + true, + ) const { config, oracles } = (await program.account.state.fetch(address)) as any const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), address.toBuffer()], From b50eb2e24381f607a6a2e453bdb3477846fed1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 10 Aug 2022 11:11:19 +0900 Subject: [PATCH 38/47] Handle closed token accounts when paying out oracles --- contracts/programs/ocr2/src/context.rs | 7 ++ contracts/programs/ocr2/src/lib.rs | 16 ++++- contracts/tests/ocr2.spec.ts | 71 ++++++++++++------- .../contracts/ocr2/proposal/acceptProposal.ts | 12 +++- .../src/commands/contracts/ocr2/setBilling.ts | 12 +++- 5 files changed, 90 insertions(+), 28 deletions(-) diff --git a/contracts/programs/ocr2/src/context.rs b/contracts/programs/ocr2/src/context.rs index 048cded12..72ba92323 100644 --- a/contracts/programs/ocr2/src/context.rs +++ b/contracts/programs/ocr2/src/context.rs @@ -108,6 +108,9 @@ pub struct AcceptProposal<'info> { pub proposal: AccountLoader<'info, Proposal>, #[account(mut)] pub receiver: SystemAccount<'info>, + // Receives LINK amount from oracles with closed token accounts + #[account(mut, token::mint = state.load()?.config.token_mint)] + pub token_receiver: Account<'info, TokenAccount>, #[account(address = state.load()?.config.owner @ ErrorCode::Unauthorized)] pub authority: Signer<'info>, @@ -158,6 +161,10 @@ pub struct SetBilling<'info> { pub authority: Signer<'info>, pub access_controller: AccountLoader<'info, AccessController>, + // Receives LINK amount from oracles with closed token accounts + #[account(mut, token::mint = state.load()?.config.token_mint)] + pub token_receiver: Account<'info, TokenAccount>, + #[account(mut, address = state.load()?.config.token_vault)] pub token_vault: Account<'info, TokenAccount>, /// CHECK: This is a PDA diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index febc9231c..eb93c6394 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -59,6 +59,7 @@ pub mod ocr2 { ctx.accounts.token_vault.to_account_info(), ctx.accounts.vault_authority.clone(), ctx.remaining_accounts, + ctx.accounts.token_receiver.to_account_info(), )?; // Transfer out remaining balance from the token_vault @@ -167,6 +168,7 @@ pub mod ocr2 { ctx.accounts.token_vault.to_account_info(), ctx.accounts.vault_authority.clone(), ctx.remaining_accounts, + ctx.accounts.token_receiver.to_account_info(), )?; let mut state = ctx.accounts.state.load_mut()?; @@ -379,6 +381,7 @@ pub mod ocr2 { ctx.accounts.token_vault.to_account_info(), ctx.accounts.vault_authority.clone(), ctx.remaining_accounts, + ctx.accounts.token_receiver.to_account_info(), )?; // Then update the config @@ -472,6 +475,7 @@ pub mod ocr2 { ctx.accounts.token_vault.to_account_info(), ctx.accounts.vault_authority.clone(), ctx.remaining_accounts, + ctx.accounts.token_receiver.to_account_info(), ) } @@ -537,6 +541,7 @@ fn pay_oracles_impl<'info>( token_vault: AccountInfo<'info>, vault_authority: AccountInfo<'info>, remaining_accounts: &[AccountInfo<'info>], + token_receiver: AccountInfo<'info>, ) -> Result<()> { let state_id = state.key(); let mut state = state.load_mut()?; @@ -563,11 +568,18 @@ fn pay_oracles_impl<'info>( oracle.payment_gjuels = 0; oracle.from_round_id = latest_round_id; + let to = if payee.owner == &token::ID { + payee.to_account_info() + } else { + // then the token account must be closed + token_receiver.to_account_info() + }; + let cpi = CpiContext::new( token_program.clone(), token::Transfer { from: token_vault.clone(), - to: payee.to_account_info(), + to, authority: vault_authority.clone(), }, ); @@ -587,7 +599,7 @@ fn pay_oracles_impl<'info>( token::transfer( cpi.with_signer(&[&[b"vault".as_ref(), state_id.as_ref(), &[vault_nonce]]]), amount_gjuels, - )?; + )? } Ok(()) diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 3b2352cac..6dfefae73 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -11,10 +11,12 @@ import { import { createMint, createAccount, + closeAccount, mintTo, getAccount, getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID, + Account, } from "@solana/spl-token"; import { assert } from "chai"; @@ -85,6 +87,7 @@ describe("ocr2", async () => { let token: PublicKey; let storeAuthority: PublicKey, storeNonce: number; let tokenVault: PublicKey, vaultAuthority: PublicKey, vaultNonce: number; + let recipient: PublicKey, recipientTokenAccount: Account; let oracles = []; const f = 6; @@ -261,13 +264,21 @@ describe("ocr2", async () => { 9 // SPL tokens use a u64, we can fit enough total supply in 9 decimals. Smallest unit is Gjuels ); - // tokenClient = new Token( - // provider.connection, - // token.publicKey, - // TOKEN_PROGRAM_ID, - // // @ts-ignore - // program.provider.wallet.payer - // ); + const placeholder = Keypair.generate().publicKey; + recipient = await createAccount( + provider.connection, + fromWallet, + token, + placeholder + ); + // TODO: it complains account is off curve + recipientTokenAccount = await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, + recipient, + true + ); }); it("Creates access controllers", async () => { @@ -583,6 +594,7 @@ describe("ocr2", async () => { proposal: proposal.publicKey, receiver: owner.publicKey, authority: owner.publicKey, + tokenReceiver: recipientTokenAccount.address, tokenVault: tokenVault, vaultAuthority: vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, @@ -670,6 +682,7 @@ describe("ocr2", async () => { state: state.publicKey, authority: owner.publicKey, accessController: billingAccessController.publicKey, + tokenReceiver: recipientTokenAccount.address, tokenVault: tokenVault, vaultAuthority: vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, @@ -811,22 +824,6 @@ describe("ocr2", async () => { }); it("Withdraws funds", async () => { - const placeholder = Keypair.generate().publicKey; - const recipient = await createAccount( - provider.connection, - fromWallet, - token, - placeholder - ); - // TODO: it complains account is off curve - let recipientTokenAccount = await getOrCreateAssociatedTokenAccount( - provider.connection, - fromWallet, - token, - recipient, - true - ); - await program.rpc.withdrawFunds(new BN(1), { accounts: { state: state.publicKey, @@ -932,11 +929,34 @@ describe("ocr2", async () => { return { pubkey: oracle.payee, isWritable: true, isSigner: false }; }); + // can still pay out oracles even if a token account is closed + + // Close oracle0's token account + let oracle = oracles[0] + let tx = await closeAccount( + provider.connection, + fromWallet, + oracle.payee.address, // account + recipientTokenAccount.address, // destination + oracle.transmitter, // authority + ); + await provider.connection.confirmTransaction(tx); + + // TODO: it complains account is off curve + recipientTokenAccount = await getOrCreateAssociatedTokenAccount( + provider.connection, + fromWallet, + token, + recipient, + true + ); + await program.rpc.payOracles({ accounts: { state: state.publicKey, authority: owner.publicKey, accessController: billingAccessController.publicKey, + tokenReceiver: recipientTokenAccount.address, tokenVault: tokenVault, vaultAuthority: vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, @@ -944,7 +964,10 @@ describe("ocr2", async () => { remainingAccounts: payees, }); - for (let i = 0; i < payees.length; i++) { + // TODO: check remaining amount on tokenRecipient + + // NOTE: we skip payees0 since it's closed + for (let i = 1; i < payees.length; i++) { const account = await getAccount(provider.connection, payees[i].pubkey); if (payees[i].pubkey.equals(transmitter)) { // transmitter + observation payment diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts index 5e92d9726..64b42be96 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts @@ -3,7 +3,7 @@ import { createHash } from 'crypto' import { logger, prompt, BN } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' import { PublicKey } from '@solana/web3.js' -import { TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { utils } from '@project-serum/anchor' import { CONTRACT_LIST, getContract } from '../../../../lib/contracts' import ProposeOffchainConfig, { OffchainConfig } from '../proposeOffchainConfig' @@ -209,6 +209,15 @@ export default class AcceptProposal extends SolanaCommand { } makeRawTransaction = async (signer: PublicKey) => { + const linkPublicKey = new PublicKey(this.flags.link || process.env.LINK) + const tokenRecipient = await getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.wallet.payer, + linkPublicKey, + this.provider.wallet.publicKey, + true, + ) + const tx = await this.program.methods .acceptProposal(this.contractInput.offchainDigest) .accounts({ @@ -216,6 +225,7 @@ export default class AcceptProposal extends SolanaCommand { proposal: new PublicKey(this.input.proposalId), receiver: signer, authority: signer, + tokenRecipient: tokenRecipient.address, tokenVault: this.contractInput.tokenVault, vaultAuthority: this.contractInput.vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts index 40be04f46..fc1cd5f51 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/setBilling.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' import { PublicKey } from '@solana/web3.js' -import { TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { utils } from '@project-serum/anchor' import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' @@ -58,6 +58,15 @@ export default class SetBilling extends SolanaCommand { const state = new PublicKey(this.args[0]) const info = (await this.program.account.state.fetch(state)) as any + + const linkPublicKey = new PublicKey(this.flags.link || process.env.LINK) + const tokenRecipient = await getOrCreateAssociatedTokenAccount( + this.provider.connection, + this.wallet.payer, + linkPublicKey, + this.provider.wallet.publicKey, + true, + ) const tokenVault = new PublicKey(info.config.tokenVault) const [vaultAuthority] = await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode('vault')), state.toBuffer()], @@ -74,6 +83,7 @@ export default class SetBilling extends SolanaCommand { state, authority: signer, accessController: billingAC, + tokenRecipient: tokenRecipient.address, tokenVault: tokenVault, vaultAuthority: vaultAuthority, tokenProgram: TOKEN_PROGRAM_ID, From 37ad15fa489d037b3aa3e957801458482cc0cb3c Mon Sep 17 00:00:00 2001 From: skudasov Date: Mon, 12 Sep 2022 08:36:56 +0200 Subject: [PATCH 39/47] regenerate bindings, fix tests --- .../access_controller/AcceptOwnership.go | 10 +- .../generated/access_controller/AddAccess.go | 14 +- .../generated/access_controller/Initialize.go | 10 +- .../access_controller/RemoveAccess.go | 14 +- .../access_controller/TransferOwnership.go | 10 +- contracts/generated/ocr2/AcceptOwnership.go | 12 +- .../generated/ocr2/AcceptOwnership_test.go | 2 +- contracts/generated/ocr2/AcceptPayeeship.go | 20 +- .../generated/ocr2/AcceptPayeeship_test.go | 2 +- contracts/generated/ocr2/AcceptProposal.go | 77 +++++--- .../generated/ocr2/AcceptProposal_test.go | 2 +- contracts/generated/ocr2/Close.go | 73 +++++--- contracts/generated/ocr2/CloseProposal.go | 16 +- .../generated/ocr2/CloseProposal_test.go | 2 +- contracts/generated/ocr2/Close_test.go | 2 +- contracts/generated/ocr2/CreateProposal.go | 12 +- .../generated/ocr2/CreateProposal_test.go | 2 +- contracts/generated/ocr2/FinalizeProposal.go | 12 +- .../generated/ocr2/FinalizeProposal_test.go | 2 +- contracts/generated/ocr2/Initialize.go | 173 ++++-------------- contracts/generated/ocr2/Initialize_test.go | 2 +- contracts/generated/ocr2/PayOracles.go | 67 ++++--- contracts/generated/ocr2/PayOracles_test.go | 2 +- contracts/generated/ocr2/ProposeConfig.go | 12 +- .../generated/ocr2/ProposeConfig_test.go | 2 +- contracts/generated/ocr2/ProposePayees.go | 12 +- .../generated/ocr2/ProposePayees_test.go | 2 +- contracts/generated/ocr2/RequestNewRound.go | 16 +- .../generated/ocr2/RequestNewRound_test.go | 2 +- contracts/generated/ocr2/SetBilling.go | 67 ++++--- .../ocr2/SetBillingAccessController.go | 16 +- .../ocr2/SetBillingAccessController_test.go | 2 +- contracts/generated/ocr2/SetBilling_test.go | 2 +- .../ocr2/SetRequesterAccessController.go | 16 +- .../ocr2/SetRequesterAccessController_test.go | 2 +- contracts/generated/ocr2/TransferOwnership.go | 12 +- .../generated/ocr2/TransferOwnership_test.go | 2 +- contracts/generated/ocr2/TransferPayeeship.go | 24 +-- .../generated/ocr2/TransferPayeeship_test.go | 2 +- contracts/generated/ocr2/WithdrawFunds.go | 32 ++-- .../generated/ocr2/WithdrawFunds_test.go | 2 +- contracts/generated/ocr2/WithdrawPayment.go | 28 +-- .../generated/ocr2/WithdrawPayment_test.go | 2 +- .../generated/ocr2/WriteOffchainConfig.go | 12 +- .../ocr2/WriteOffchainConfig_test.go | 2 +- contracts/generated/ocr2/accounts.go | 2 +- contracts/generated/ocr2/instructions.go | 2 +- contracts/generated/ocr2/testing_utils.go | 2 +- contracts/generated/ocr2/types.go | 2 +- .../generated/store/AcceptFeedOwnership.go | 14 +- .../generated/store/AcceptStoreOwnership.go | 10 +- contracts/generated/store/CloseFeed.go | 18 +- contracts/generated/store/CreateFeed.go | 10 +- contracts/generated/store/Initialize.go | 14 +- contracts/generated/store/LowerFlag.go | 18 +- contracts/generated/store/Query.go | 28 +-- .../store/SetLoweringAccessController.go | 14 +- .../generated/store/SetValidatorConfig.go | 14 +- contracts/generated/store/SetWriter.go | 14 +- contracts/generated/store/Submit.go | 10 +- .../generated/store/TransferFeedOwnership.go | 14 +- .../generated/store/TransferStoreOwnership.go | 10 +- contracts/generated/store/types.go | 60 +++--- .../artifacts/schemas/ocr2.json | 53 +++--- tests/e2e/common/common.go | 2 +- tests/e2e/solclient/deployer.go | 113 +++++++----- tests/e2e/solclient/ocr2.go | 87 ++++----- tests/e2e/solclient/solclient.go | 13 +- 68 files changed, 660 insertions(+), 671 deletions(-) diff --git a/contracts/generated/access_controller/AcceptOwnership.go b/contracts/generated/access_controller/AcceptOwnership.go index 23541f084..6c5177cde 100644 --- a/contracts/generated/access_controller/AcceptOwnership.go +++ b/contracts/generated/access_controller/AcceptOwnership.go @@ -16,7 +16,7 @@ type AcceptOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. @@ -35,7 +35,7 @@ func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *Accep // GetStateAccount gets the "state" account. func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst AcceptOwnership) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/access_controller/AddAccess.go b/contracts/generated/access_controller/AddAccess.go index c4506b7ec..3c7488630 100644 --- a/contracts/generated/access_controller/AddAccess.go +++ b/contracts/generated/access_controller/AddAccess.go @@ -18,7 +18,7 @@ type AddAccess struct { // [1] = [SIGNER] owner // // [2] = [] address - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAddAccessInstructionBuilder creates a new `AddAccess` instruction builder. @@ -37,7 +37,7 @@ func (inst *AddAccess) SetStateAccount(state ag_solanago.PublicKey) *AddAccess { // GetStateAccount gets the "state" account. func (inst *AddAccess) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -48,7 +48,7 @@ func (inst *AddAccess) SetOwnerAccount(owner ag_solanago.PublicKey) *AddAccess { // GetOwnerAccount gets the "owner" account. func (inst *AddAccess) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAddressAccount sets the "address" account. @@ -59,7 +59,7 @@ func (inst *AddAccess) SetAddressAccount(address ag_solanago.PublicKey) *AddAcce // GetAddressAccount gets the "address" account. func (inst *AddAccess) GetAddressAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst AddAccess) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *AddAccess) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/access_controller/Initialize.go b/contracts/generated/access_controller/Initialize.go index 78fbaa644..ce22ef71b 100644 --- a/contracts/generated/access_controller/Initialize.go +++ b/contracts/generated/access_controller/Initialize.go @@ -16,7 +16,7 @@ type Initialize struct { // [0] = [WRITE] state // // [1] = [SIGNER] owner - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. @@ -35,7 +35,7 @@ func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize // GetStateAccount gets the "state" account. func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -46,7 +46,7 @@ func (inst *Initialize) SetOwnerAccount(owner ag_solanago.PublicKey) *Initialize // GetOwnerAccount gets the "owner" account. func (inst *Initialize) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst Initialize) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta("state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("owner", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta("state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("owner", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/access_controller/RemoveAccess.go b/contracts/generated/access_controller/RemoveAccess.go index 31bafb811..567a66b5a 100644 --- a/contracts/generated/access_controller/RemoveAccess.go +++ b/contracts/generated/access_controller/RemoveAccess.go @@ -18,7 +18,7 @@ type RemoveAccess struct { // [1] = [SIGNER] owner // // [2] = [] address - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewRemoveAccessInstructionBuilder creates a new `RemoveAccess` instruction builder. @@ -37,7 +37,7 @@ func (inst *RemoveAccess) SetStateAccount(state ag_solanago.PublicKey) *RemoveAc // GetStateAccount gets the "state" account. func (inst *RemoveAccess) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -48,7 +48,7 @@ func (inst *RemoveAccess) SetOwnerAccount(owner ag_solanago.PublicKey) *RemoveAc // GetOwnerAccount gets the "owner" account. func (inst *RemoveAccess) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAddressAccount sets the "address" account. @@ -59,7 +59,7 @@ func (inst *RemoveAccess) SetAddressAccount(address ag_solanago.PublicKey) *Remo // GetAddressAccount gets the "address" account. func (inst *RemoveAccess) GetAddressAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst RemoveAccess) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *RemoveAccess) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("address", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/access_controller/TransferOwnership.go b/contracts/generated/access_controller/TransferOwnership.go index e057d2030..c6b8f3f50 100644 --- a/contracts/generated/access_controller/TransferOwnership.go +++ b/contracts/generated/access_controller/TransferOwnership.go @@ -17,7 +17,7 @@ type TransferOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. @@ -42,7 +42,7 @@ func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *Tra // GetStateAccount gets the "state" account. func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicK // GetAuthorityAccount gets the "authority" account. func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst TransferOwnership) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/AcceptOwnership.go b/contracts/generated/ocr2/AcceptOwnership.go index aec920ac5..666a8211b 100644 --- a/contracts/generated/ocr2/AcceptOwnership.go +++ b/contracts/generated/ocr2/AcceptOwnership.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -16,7 +16,7 @@ type AcceptOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAcceptOwnershipInstructionBuilder creates a new `AcceptOwnership` instruction builder. @@ -35,7 +35,7 @@ func (inst *AcceptOwnership) SetStateAccount(state ag_solanago.PublicKey) *Accep // GetStateAccount gets the "state" account. func (inst *AcceptOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *AcceptOwnership) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *AcceptOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst AcceptOwnership) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *AcceptOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/AcceptOwnership_test.go b/contracts/generated/ocr2/AcceptOwnership_test.go index d3776ba67..4771fa165 100644 --- a/contracts/generated/ocr2/AcceptOwnership_test.go +++ b/contracts/generated/ocr2/AcceptOwnership_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/AcceptPayeeship.go b/contracts/generated/ocr2/AcceptPayeeship.go index 80913b2c3..95ae73dc3 100644 --- a/contracts/generated/ocr2/AcceptPayeeship.go +++ b/contracts/generated/ocr2/AcceptPayeeship.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -20,7 +20,7 @@ type AcceptPayeeship struct { // [2] = [] transmitter // // [3] = [] proposedPayee - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAcceptPayeeshipInstructionBuilder creates a new `AcceptPayeeship` instruction builder. @@ -39,7 +39,7 @@ func (inst *AcceptPayeeship) SetStateAccount(state ag_solanago.PublicKey) *Accep // GetStateAccount gets the "state" account. func (inst *AcceptPayeeship) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -50,7 +50,7 @@ func (inst *AcceptPayeeship) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *AcceptPayeeship) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetTransmitterAccount sets the "transmitter" account. @@ -61,7 +61,7 @@ func (inst *AcceptPayeeship) SetTransmitterAccount(transmitter ag_solanago.Publi // GetTransmitterAccount gets the "transmitter" account. func (inst *AcceptPayeeship) GetTransmitterAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } // SetProposedPayeeAccount sets the "proposedPayee" account. @@ -72,7 +72,7 @@ func (inst *AcceptPayeeship) SetProposedPayeeAccount(proposedPayee ag_solanago.P // GetProposedPayeeAccount gets the "proposedPayee" account. func (inst *AcceptPayeeship) GetProposedPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[3] } func (inst AcceptPayeeship) Build() *Instruction { @@ -124,10 +124,10 @@ func (inst *AcceptPayeeship) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice[3])) }) }) }) diff --git a/contracts/generated/ocr2/AcceptPayeeship_test.go b/contracts/generated/ocr2/AcceptPayeeship_test.go index 66ef97b2a..6a8f5c967 100644 --- a/contracts/generated/ocr2/AcceptPayeeship_test.go +++ b/contracts/generated/ocr2/AcceptPayeeship_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/AcceptProposal.go b/contracts/generated/ocr2/AcceptProposal.go index 9b5fb37ed..32f0a06d0 100644 --- a/contracts/generated/ocr2/AcceptProposal.go +++ b/contracts/generated/ocr2/AcceptProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -20,20 +20,22 @@ type AcceptProposal struct { // // [2] = [WRITE] receiver // - // [3] = [SIGNER] authority + // [3] = [WRITE] tokenReceiver // - // [4] = [WRITE] tokenVault + // [4] = [SIGNER] authority // - // [5] = [] vaultAuthority + // [5] = [WRITE] tokenVault // - // [6] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + // [6] = [] vaultAuthority + // + // [7] = [] tokenProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAcceptProposalInstructionBuilder creates a new `AcceptProposal` instruction builder. func NewAcceptProposalInstructionBuilder() *AcceptProposal { nd := &AcceptProposal{ - AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 8), } return nd } @@ -52,7 +54,7 @@ func (inst *AcceptProposal) SetStateAccount(state ag_solanago.PublicKey) *Accept // GetStateAccount gets the "state" account. func (inst *AcceptProposal) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetProposalAccount sets the "proposal" account. @@ -63,7 +65,7 @@ func (inst *AcceptProposal) SetProposalAccount(proposal ag_solanago.PublicKey) * // GetProposalAccount gets the "proposal" account. func (inst *AcceptProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetReceiverAccount sets the "receiver" account. @@ -74,51 +76,62 @@ func (inst *AcceptProposal) SetReceiverAccount(receiver ag_solanago.PublicKey) * // GetReceiverAccount gets the "receiver" account. func (inst *AcceptProposal) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] +} + +// SetTokenReceiverAccount sets the "tokenReceiver" account. +func (inst *AcceptProposal) SetTokenReceiverAccount(tokenReceiver ag_solanago.PublicKey) *AcceptProposal { + inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenReceiver).WRITE() + return inst +} + +// GetTokenReceiverAccount gets the "tokenReceiver" account. +func (inst *AcceptProposal) GetTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] } // SetAuthorityAccount sets the "authority" account. func (inst *AcceptProposal) SetAuthorityAccount(authority ag_solanago.PublicKey) *AcceptProposal { - inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).SIGNER() + inst.AccountMetaSlice[4] = ag_solanago.Meta(authority).SIGNER() return inst } // GetAuthorityAccount gets the "authority" account. func (inst *AcceptProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[4] } // SetTokenVaultAccount sets the "tokenVault" account. func (inst *AcceptProposal) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) *AcceptProposal { - inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenVault).WRITE() + inst.AccountMetaSlice[5] = ag_solanago.Meta(tokenVault).WRITE() return inst } // GetTokenVaultAccount gets the "tokenVault" account. func (inst *AcceptProposal) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[5] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. func (inst *AcceptProposal) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *AcceptProposal { - inst.AccountMetaSlice[5] = ag_solanago.Meta(vaultAuthority) + inst.AccountMetaSlice[6] = ag_solanago.Meta(vaultAuthority) return inst } // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *AcceptProposal) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[6] } // SetTokenProgramAccount sets the "tokenProgram" account. func (inst *AcceptProposal) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *AcceptProposal { - inst.AccountMetaSlice[6] = ag_solanago.Meta(tokenProgram) + inst.AccountMetaSlice[7] = ag_solanago.Meta(tokenProgram) return inst } // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *AcceptProposal) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(6) + return inst.AccountMetaSlice[7] } func (inst AcceptProposal) Build() *Instruction { @@ -158,15 +171,18 @@ func (inst *AcceptProposal) Validate() error { return errors.New("accounts.Receiver is not set") } if inst.AccountMetaSlice[3] == nil { - return errors.New("accounts.Authority is not set") + return errors.New("accounts.TokenReceiver is not set") } if inst.AccountMetaSlice[4] == nil { - return errors.New("accounts.TokenVault is not set") + return errors.New("accounts.Authority is not set") } if inst.AccountMetaSlice[5] == nil { - return errors.New("accounts.VaultAuthority is not set") + return errors.New("accounts.TokenVault is not set") } if inst.AccountMetaSlice[6] == nil { + return errors.New("accounts.VaultAuthority is not set") + } + if inst.AccountMetaSlice[7] == nil { return errors.New("accounts.TokenProgram is not set") } } @@ -187,14 +203,15 @@ func (inst *AcceptProposal) EncodeToTree(parent ag_treeout.Branches) { }) // Accounts of the instruction: - instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice.Get(5))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(6))) + instructionBranch.Child("Accounts[len=8]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" tokenReceiver", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[7])) }) }) }) @@ -225,6 +242,7 @@ func NewAcceptProposalInstruction( state ag_solanago.PublicKey, proposal ag_solanago.PublicKey, receiver ag_solanago.PublicKey, + tokenReceiver ag_solanago.PublicKey, authority ag_solanago.PublicKey, tokenVault ag_solanago.PublicKey, vaultAuthority ag_solanago.PublicKey, @@ -234,6 +252,7 @@ func NewAcceptProposalInstruction( SetStateAccount(state). SetProposalAccount(proposal). SetReceiverAccount(receiver). + SetTokenReceiverAccount(tokenReceiver). SetAuthorityAccount(authority). SetTokenVaultAccount(tokenVault). SetVaultAuthorityAccount(vaultAuthority). diff --git a/contracts/generated/ocr2/AcceptProposal_test.go b/contracts/generated/ocr2/AcceptProposal_test.go index 1d085aff5..71e1660a0 100644 --- a/contracts/generated/ocr2/AcceptProposal_test.go +++ b/contracts/generated/ocr2/AcceptProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/Close.go b/contracts/generated/ocr2/Close.go index 1018424d3..29f8b4781 100644 --- a/contracts/generated/ocr2/Close.go +++ b/contracts/generated/ocr2/Close.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -17,20 +17,22 @@ type Close struct { // // [1] = [WRITE] receiver // - // [2] = [SIGNER] authority + // [2] = [WRITE] tokenReceiver // - // [3] = [WRITE] tokenVault + // [3] = [SIGNER] authority // - // [4] = [] vaultAuthority + // [4] = [WRITE] tokenVault // - // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + // [5] = [] vaultAuthority + // + // [6] = [] tokenProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewCloseInstructionBuilder creates a new `Close` instruction builder. func NewCloseInstructionBuilder() *Close { nd := &Close{ - AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), } return nd } @@ -43,7 +45,7 @@ func (inst *Close) SetStateAccount(state ag_solanago.PublicKey) *Close { // GetStateAccount gets the "state" account. func (inst *Close) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetReceiverAccount sets the "receiver" account. @@ -54,51 +56,62 @@ func (inst *Close) SetReceiverAccount(receiver ag_solanago.PublicKey) *Close { // GetReceiverAccount gets the "receiver" account. func (inst *Close) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] +} + +// SetTokenReceiverAccount sets the "tokenReceiver" account. +func (inst *Close) SetTokenReceiverAccount(tokenReceiver ag_solanago.PublicKey) *Close { + inst.AccountMetaSlice[2] = ag_solanago.Meta(tokenReceiver).WRITE() + return inst +} + +// GetTokenReceiverAccount gets the "tokenReceiver" account. +func (inst *Close) GetTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[2] } // SetAuthorityAccount sets the "authority" account. func (inst *Close) SetAuthorityAccount(authority ag_solanago.PublicKey) *Close { - inst.AccountMetaSlice[2] = ag_solanago.Meta(authority).SIGNER() + inst.AccountMetaSlice[3] = ag_solanago.Meta(authority).SIGNER() return inst } // GetAuthorityAccount gets the "authority" account. func (inst *Close) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[3] } // SetTokenVaultAccount sets the "tokenVault" account. func (inst *Close) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) *Close { - inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenVault).WRITE() + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenVault).WRITE() return inst } // GetTokenVaultAccount gets the "tokenVault" account. func (inst *Close) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[4] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. func (inst *Close) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *Close { - inst.AccountMetaSlice[4] = ag_solanago.Meta(vaultAuthority) + inst.AccountMetaSlice[5] = ag_solanago.Meta(vaultAuthority) return inst } // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *Close) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[5] } // SetTokenProgramAccount sets the "tokenProgram" account. func (inst *Close) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *Close { - inst.AccountMetaSlice[5] = ag_solanago.Meta(tokenProgram) + inst.AccountMetaSlice[6] = ag_solanago.Meta(tokenProgram) return inst } // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *Close) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[6] } func (inst Close) Build() *Instruction { @@ -128,15 +141,18 @@ func (inst *Close) Validate() error { return errors.New("accounts.Receiver is not set") } if inst.AccountMetaSlice[2] == nil { - return errors.New("accounts.Authority is not set") + return errors.New("accounts.TokenReceiver is not set") } if inst.AccountMetaSlice[3] == nil { - return errors.New("accounts.TokenVault is not set") + return errors.New("accounts.Authority is not set") } if inst.AccountMetaSlice[4] == nil { - return errors.New("accounts.VaultAuthority is not set") + return errors.New("accounts.TokenVault is not set") } if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.VaultAuthority is not set") + } + if inst.AccountMetaSlice[6] == nil { return errors.New("accounts.TokenProgram is not set") } } @@ -155,13 +171,14 @@ func (inst *Close) EncodeToTree(parent ag_treeout.Branches) { instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) // Accounts of the instruction: - instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenReceiver", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) }) }) }) @@ -179,6 +196,7 @@ func NewCloseInstruction( // Accounts: state ag_solanago.PublicKey, receiver ag_solanago.PublicKey, + tokenReceiver ag_solanago.PublicKey, authority ag_solanago.PublicKey, tokenVault ag_solanago.PublicKey, vaultAuthority ag_solanago.PublicKey, @@ -186,6 +204,7 @@ func NewCloseInstruction( return NewCloseInstructionBuilder(). SetStateAccount(state). SetReceiverAccount(receiver). + SetTokenReceiverAccount(tokenReceiver). SetAuthorityAccount(authority). SetTokenVaultAccount(tokenVault). SetVaultAuthorityAccount(vaultAuthority). diff --git a/contracts/generated/ocr2/CloseProposal.go b/contracts/generated/ocr2/CloseProposal.go index 1adb45395..3f852ecf3 100644 --- a/contracts/generated/ocr2/CloseProposal.go +++ b/contracts/generated/ocr2/CloseProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -18,7 +18,7 @@ type CloseProposal struct { // [1] = [WRITE] receiver // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewCloseProposalInstructionBuilder creates a new `CloseProposal` instruction builder. @@ -37,7 +37,7 @@ func (inst *CloseProposal) SetProposalAccount(proposal ag_solanago.PublicKey) *C // GetProposalAccount gets the "proposal" account. func (inst *CloseProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetReceiverAccount sets the "receiver" account. @@ -48,7 +48,7 @@ func (inst *CloseProposal) SetReceiverAccount(receiver ag_solanago.PublicKey) *C // GetReceiverAccount gets the "receiver" account. func (inst *CloseProposal) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAuthorityAccount sets the "authority" account. @@ -59,7 +59,7 @@ func (inst *CloseProposal) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *CloseProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst CloseProposal) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *CloseProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/ocr2/CloseProposal_test.go b/contracts/generated/ocr2/CloseProposal_test.go index 205f1cf25..80ffba3e6 100644 --- a/contracts/generated/ocr2/CloseProposal_test.go +++ b/contracts/generated/ocr2/CloseProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/Close_test.go b/contracts/generated/ocr2/Close_test.go index 1dd86086b..43c83073c 100644 --- a/contracts/generated/ocr2/Close_test.go +++ b/contracts/generated/ocr2/Close_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/CreateProposal.go b/contracts/generated/ocr2/CreateProposal.go index de9df7930..9ed55f296 100644 --- a/contracts/generated/ocr2/CreateProposal.go +++ b/contracts/generated/ocr2/CreateProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -17,7 +17,7 @@ type CreateProposal struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewCreateProposalInstructionBuilder creates a new `CreateProposal` instruction builder. @@ -42,7 +42,7 @@ func (inst *CreateProposal) SetProposalAccount(proposal ag_solanago.PublicKey) * // GetProposalAccount gets the "proposal" account. func (inst *CreateProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *CreateProposal) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *CreateProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst CreateProposal) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *CreateProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/CreateProposal_test.go b/contracts/generated/ocr2/CreateProposal_test.go index 89f18f149..7c769350b 100644 --- a/contracts/generated/ocr2/CreateProposal_test.go +++ b/contracts/generated/ocr2/CreateProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/FinalizeProposal.go b/contracts/generated/ocr2/FinalizeProposal.go index 5abd17d97..92bad057c 100644 --- a/contracts/generated/ocr2/FinalizeProposal.go +++ b/contracts/generated/ocr2/FinalizeProposal.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -16,7 +16,7 @@ type FinalizeProposal struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewFinalizeProposalInstructionBuilder creates a new `FinalizeProposal` instruction builder. @@ -35,7 +35,7 @@ func (inst *FinalizeProposal) SetProposalAccount(proposal ag_solanago.PublicKey) // GetProposalAccount gets the "proposal" account. func (inst *FinalizeProposal) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *FinalizeProposal) SetAuthorityAccount(authority ag_solanago.PublicKe // GetAuthorityAccount gets the "authority" account. func (inst *FinalizeProposal) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst FinalizeProposal) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *FinalizeProposal) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/FinalizeProposal_test.go b/contracts/generated/ocr2/FinalizeProposal_test.go index 43e74f84b..04552a616 100644 --- a/contracts/generated/ocr2/FinalizeProposal_test.go +++ b/contracts/generated/ocr2/FinalizeProposal_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/Initialize.go b/contracts/generated/ocr2/Initialize.go index b9cf89e98..e7e573a70 100644 --- a/contracts/generated/ocr2/Initialize.go +++ b/contracts/generated/ocr2/Initialize.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -19,34 +19,24 @@ type Initialize struct { // // [1] = [] feed // - // [2] = [WRITE, SIGNER] payer + // [2] = [SIGNER] owner // - // [3] = [SIGNER] owner + // [3] = [] tokenMint // - // [4] = [] tokenMint + // [4] = [] tokenVault // - // [5] = [WRITE] tokenVault + // [5] = [] vaultAuthority // - // [6] = [] vaultAuthority + // [6] = [] requesterAccessController // - // [7] = [] requesterAccessController - // - // [8] = [] billingAccessController - // - // [9] = [] rent - // - // [10] = [] systemProgram - // - // [11] = [] tokenProgram - // - // [12] = [] associatedTokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + // [7] = [] billingAccessController + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. func NewInitializeInstructionBuilder() *Initialize { nd := &Initialize{ - AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 13), + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 8), } return nd } @@ -71,7 +61,7 @@ func (inst *Initialize) SetStateAccount(state ag_solanago.PublicKey) *Initialize // GetStateAccount gets the "state" account. func (inst *Initialize) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetFeedAccount sets the "feed" account. @@ -82,128 +72,73 @@ func (inst *Initialize) SetFeedAccount(feed ag_solanago.PublicKey) *Initialize { // GetFeedAccount gets the "feed" account. func (inst *Initialize) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) -} - -// SetPayerAccount sets the "payer" account. -func (inst *Initialize) SetPayerAccount(payer ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[2] = ag_solanago.Meta(payer).WRITE().SIGNER() - return inst -} - -// GetPayerAccount gets the "payer" account. -func (inst *Initialize) GetPayerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[1] } // SetOwnerAccount sets the "owner" account. func (inst *Initialize) SetOwnerAccount(owner ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[3] = ag_solanago.Meta(owner).SIGNER() + inst.AccountMetaSlice[2] = ag_solanago.Meta(owner).SIGNER() return inst } // GetOwnerAccount gets the "owner" account. func (inst *Initialize) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[2] } // SetTokenMintAccount sets the "tokenMint" account. func (inst *Initialize) SetTokenMintAccount(tokenMint ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenMint) + inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenMint) return inst } // GetTokenMintAccount gets the "tokenMint" account. func (inst *Initialize) GetTokenMintAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[3] } // SetTokenVaultAccount sets the "tokenVault" account. func (inst *Initialize) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[5] = ag_solanago.Meta(tokenVault).WRITE() + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenVault) return inst } // GetTokenVaultAccount gets the "tokenVault" account. func (inst *Initialize) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[4] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. func (inst *Initialize) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[6] = ag_solanago.Meta(vaultAuthority) + inst.AccountMetaSlice[5] = ag_solanago.Meta(vaultAuthority) return inst } // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *Initialize) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(6) + return inst.AccountMetaSlice[5] } // SetRequesterAccessControllerAccount sets the "requesterAccessController" account. func (inst *Initialize) SetRequesterAccessControllerAccount(requesterAccessController ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[7] = ag_solanago.Meta(requesterAccessController) + inst.AccountMetaSlice[6] = ag_solanago.Meta(requesterAccessController) return inst } // GetRequesterAccessControllerAccount gets the "requesterAccessController" account. func (inst *Initialize) GetRequesterAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(7) + return inst.AccountMetaSlice[6] } // SetBillingAccessControllerAccount sets the "billingAccessController" account. func (inst *Initialize) SetBillingAccessControllerAccount(billingAccessController ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[8] = ag_solanago.Meta(billingAccessController) + inst.AccountMetaSlice[7] = ag_solanago.Meta(billingAccessController) return inst } // GetBillingAccessControllerAccount gets the "billingAccessController" account. func (inst *Initialize) GetBillingAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(8) -} - -// SetRentAccount sets the "rent" account. -func (inst *Initialize) SetRentAccount(rent ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[9] = ag_solanago.Meta(rent) - return inst -} - -// GetRentAccount gets the "rent" account. -func (inst *Initialize) GetRentAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(9) -} - -// SetSystemProgramAccount sets the "systemProgram" account. -func (inst *Initialize) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[10] = ag_solanago.Meta(systemProgram) - return inst -} - -// GetSystemProgramAccount gets the "systemProgram" account. -func (inst *Initialize) GetSystemProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(10) -} - -// SetTokenProgramAccount sets the "tokenProgram" account. -func (inst *Initialize) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[11] = ag_solanago.Meta(tokenProgram) - return inst -} - -// GetTokenProgramAccount gets the "tokenProgram" account. -func (inst *Initialize) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(11) -} - -// SetAssociatedTokenProgramAccount sets the "associatedTokenProgram" account. -func (inst *Initialize) SetAssociatedTokenProgramAccount(associatedTokenProgram ag_solanago.PublicKey) *Initialize { - inst.AccountMetaSlice[12] = ag_solanago.Meta(associatedTokenProgram) - return inst -} - -// GetAssociatedTokenProgramAccount gets the "associatedTokenProgram" account. -func (inst *Initialize) GetAssociatedTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(12) + return inst.AccountMetaSlice[7] } func (inst Initialize) Build() *Instruction { @@ -243,38 +178,23 @@ func (inst *Initialize) Validate() error { return errors.New("accounts.Feed is not set") } if inst.AccountMetaSlice[2] == nil { - return errors.New("accounts.Payer is not set") - } - if inst.AccountMetaSlice[3] == nil { return errors.New("accounts.Owner is not set") } - if inst.AccountMetaSlice[4] == nil { + if inst.AccountMetaSlice[3] == nil { return errors.New("accounts.TokenMint is not set") } - if inst.AccountMetaSlice[5] == nil { + if inst.AccountMetaSlice[4] == nil { return errors.New("accounts.TokenVault is not set") } - if inst.AccountMetaSlice[6] == nil { + if inst.AccountMetaSlice[5] == nil { return errors.New("accounts.VaultAuthority is not set") } - if inst.AccountMetaSlice[7] == nil { + if inst.AccountMetaSlice[6] == nil { return errors.New("accounts.RequesterAccessController is not set") } - if inst.AccountMetaSlice[8] == nil { + if inst.AccountMetaSlice[7] == nil { return errors.New("accounts.BillingAccessController is not set") } - if inst.AccountMetaSlice[9] == nil { - return errors.New("accounts.Rent is not set") - } - if inst.AccountMetaSlice[10] == nil { - return errors.New("accounts.SystemProgram is not set") - } - if inst.AccountMetaSlice[11] == nil { - return errors.New("accounts.TokenProgram is not set") - } - if inst.AccountMetaSlice[12] == nil { - return errors.New("accounts.AssociatedTokenProgram is not set") - } } return nil } @@ -294,20 +214,15 @@ func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { }) // Accounts of the instruction: - instructionBranch.Child("Accounts[len=13]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" payer", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta(" tokenMint", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(5))) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(6))) - accountsBranch.Child(ag_format.Meta("requesterAccessController", inst.AccountMetaSlice.Get(7))) - accountsBranch.Child(ag_format.Meta(" billingAccessController", inst.AccountMetaSlice.Get(8))) - accountsBranch.Child(ag_format.Meta(" rent", inst.AccountMetaSlice.Get(9))) - accountsBranch.Child(ag_format.Meta(" systemProgram", inst.AccountMetaSlice.Get(10))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(11))) - accountsBranch.Child(ag_format.Meta(" associatedTokenProgram", inst.AccountMetaSlice.Get(12))) + instructionBranch.Child("Accounts[len=8]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" tokenMint", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta("requesterAccessController", inst.AccountMetaSlice[6])) + accountsBranch.Child(ag_format.Meta(" billingAccessController", inst.AccountMetaSlice[7])) }) }) }) @@ -348,31 +263,21 @@ func NewInitializeInstruction( // Accounts: state ag_solanago.PublicKey, feed ag_solanago.PublicKey, - payer ag_solanago.PublicKey, owner ag_solanago.PublicKey, tokenMint ag_solanago.PublicKey, tokenVault ag_solanago.PublicKey, vaultAuthority ag_solanago.PublicKey, requesterAccessController ag_solanago.PublicKey, - billingAccessController ag_solanago.PublicKey, - rent ag_solanago.PublicKey, - systemProgram ag_solanago.PublicKey, - tokenProgram ag_solanago.PublicKey, - associatedTokenProgram ag_solanago.PublicKey) *Initialize { + billingAccessController ag_solanago.PublicKey) *Initialize { return NewInitializeInstructionBuilder(). SetMinAnswer(minAnswer). SetMaxAnswer(maxAnswer). SetStateAccount(state). SetFeedAccount(feed). - SetPayerAccount(payer). SetOwnerAccount(owner). SetTokenMintAccount(tokenMint). SetTokenVaultAccount(tokenVault). SetVaultAuthorityAccount(vaultAuthority). SetRequesterAccessControllerAccount(requesterAccessController). - SetBillingAccessControllerAccount(billingAccessController). - SetRentAccount(rent). - SetSystemProgramAccount(systemProgram). - SetTokenProgramAccount(tokenProgram). - SetAssociatedTokenProgramAccount(associatedTokenProgram) + SetBillingAccessControllerAccount(billingAccessController) } diff --git a/contracts/generated/ocr2/Initialize_test.go b/contracts/generated/ocr2/Initialize_test.go index d87fdfea9..e007c15fe 100644 --- a/contracts/generated/ocr2/Initialize_test.go +++ b/contracts/generated/ocr2/Initialize_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/PayOracles.go b/contracts/generated/ocr2/PayOracles.go index dfd8762bc..b7983566e 100644 --- a/contracts/generated/ocr2/PayOracles.go +++ b/contracts/generated/ocr2/PayOracles.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -19,18 +19,20 @@ type PayOracles struct { // // [2] = [] accessController // - // [3] = [WRITE] tokenVault + // [3] = [WRITE] tokenReceiver // - // [4] = [] vaultAuthority + // [4] = [WRITE] tokenVault // - // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + // [5] = [] vaultAuthority + // + // [6] = [] tokenProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewPayOraclesInstructionBuilder creates a new `PayOracles` instruction builder. func NewPayOraclesInstructionBuilder() *PayOracles { nd := &PayOracles{ - AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), } return nd } @@ -43,7 +45,7 @@ func (inst *PayOracles) SetStateAccount(state ag_solanago.PublicKey) *PayOracles // GetStateAccount gets the "state" account. func (inst *PayOracles) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -54,7 +56,7 @@ func (inst *PayOracles) SetAuthorityAccount(authority ag_solanago.PublicKey) *Pa // GetAuthorityAccount gets the "authority" account. func (inst *PayOracles) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -65,40 +67,51 @@ func (inst *PayOracles) SetAccessControllerAccount(accessController ag_solanago. // GetAccessControllerAccount gets the "accessController" account. func (inst *PayOracles) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] +} + +// SetTokenReceiverAccount sets the "tokenReceiver" account. +func (inst *PayOracles) SetTokenReceiverAccount(tokenReceiver ag_solanago.PublicKey) *PayOracles { + inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenReceiver).WRITE() + return inst +} + +// GetTokenReceiverAccount gets the "tokenReceiver" account. +func (inst *PayOracles) GetTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] } // SetTokenVaultAccount sets the "tokenVault" account. func (inst *PayOracles) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) *PayOracles { - inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenVault).WRITE() + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenVault).WRITE() return inst } // GetTokenVaultAccount gets the "tokenVault" account. func (inst *PayOracles) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[4] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. func (inst *PayOracles) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *PayOracles { - inst.AccountMetaSlice[4] = ag_solanago.Meta(vaultAuthority) + inst.AccountMetaSlice[5] = ag_solanago.Meta(vaultAuthority) return inst } // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *PayOracles) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[5] } // SetTokenProgramAccount sets the "tokenProgram" account. func (inst *PayOracles) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *PayOracles { - inst.AccountMetaSlice[5] = ag_solanago.Meta(tokenProgram) + inst.AccountMetaSlice[6] = ag_solanago.Meta(tokenProgram) return inst } // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *PayOracles) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[6] } func (inst PayOracles) Build() *Instruction { @@ -131,12 +144,15 @@ func (inst *PayOracles) Validate() error { return errors.New("accounts.AccessController is not set") } if inst.AccountMetaSlice[3] == nil { - return errors.New("accounts.TokenVault is not set") + return errors.New("accounts.TokenReceiver is not set") } if inst.AccountMetaSlice[4] == nil { - return errors.New("accounts.VaultAuthority is not set") + return errors.New("accounts.TokenVault is not set") } if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.VaultAuthority is not set") + } + if inst.AccountMetaSlice[6] == nil { return errors.New("accounts.TokenProgram is not set") } } @@ -155,13 +171,14 @@ func (inst *PayOracles) EncodeToTree(parent ag_treeout.Branches) { instructionBranch.Child("Params[len=0]").ParentFunc(func(paramsBranch ag_treeout.Branches) {}) // Accounts of the instruction: - instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" tokenReceiver", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) }) }) }) @@ -180,6 +197,7 @@ func NewPayOraclesInstruction( state ag_solanago.PublicKey, authority ag_solanago.PublicKey, accessController ag_solanago.PublicKey, + tokenReceiver ag_solanago.PublicKey, tokenVault ag_solanago.PublicKey, vaultAuthority ag_solanago.PublicKey, tokenProgram ag_solanago.PublicKey) *PayOracles { @@ -187,6 +205,7 @@ func NewPayOraclesInstruction( SetStateAccount(state). SetAuthorityAccount(authority). SetAccessControllerAccount(accessController). + SetTokenReceiverAccount(tokenReceiver). SetTokenVaultAccount(tokenVault). SetVaultAuthorityAccount(vaultAuthority). SetTokenProgramAccount(tokenProgram) diff --git a/contracts/generated/ocr2/PayOracles_test.go b/contracts/generated/ocr2/PayOracles_test.go index ce8dbdb81..9755c339c 100644 --- a/contracts/generated/ocr2/PayOracles_test.go +++ b/contracts/generated/ocr2/PayOracles_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/ProposeConfig.go b/contracts/generated/ocr2/ProposeConfig.go index 468c428d6..4fb2783d9 100644 --- a/contracts/generated/ocr2/ProposeConfig.go +++ b/contracts/generated/ocr2/ProposeConfig.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -18,7 +18,7 @@ type ProposeConfig struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewProposeConfigInstructionBuilder creates a new `ProposeConfig` instruction builder. @@ -49,7 +49,7 @@ func (inst *ProposeConfig) SetProposalAccount(proposal ag_solanago.PublicKey) *P // GetProposalAccount gets the "proposal" account. func (inst *ProposeConfig) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -60,7 +60,7 @@ func (inst *ProposeConfig) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *ProposeConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst ProposeConfig) Build() *Instruction { @@ -119,8 +119,8 @@ func (inst *ProposeConfig) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/ProposeConfig_test.go b/contracts/generated/ocr2/ProposeConfig_test.go index 937c5ef48..202ff02aa 100644 --- a/contracts/generated/ocr2/ProposeConfig_test.go +++ b/contracts/generated/ocr2/ProposeConfig_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/ProposePayees.go b/contracts/generated/ocr2/ProposePayees.go index f6bec3bd1..2f39ec894 100644 --- a/contracts/generated/ocr2/ProposePayees.go +++ b/contracts/generated/ocr2/ProposePayees.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -17,7 +17,7 @@ type ProposePayees struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewProposePayeesInstructionBuilder creates a new `ProposePayees` instruction builder. @@ -42,7 +42,7 @@ func (inst *ProposePayees) SetProposalAccount(proposal ag_solanago.PublicKey) *P // GetProposalAccount gets the "proposal" account. func (inst *ProposePayees) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *ProposePayees) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *ProposePayees) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst ProposePayees) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *ProposePayees) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/ProposePayees_test.go b/contracts/generated/ocr2/ProposePayees_test.go index fff1d8e90..e481ff962 100644 --- a/contracts/generated/ocr2/ProposePayees_test.go +++ b/contracts/generated/ocr2/ProposePayees_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/RequestNewRound.go b/contracts/generated/ocr2/RequestNewRound.go index 62a9dd07f..123222300 100644 --- a/contracts/generated/ocr2/RequestNewRound.go +++ b/contracts/generated/ocr2/RequestNewRound.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -18,7 +18,7 @@ type RequestNewRound struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewRequestNewRoundInstructionBuilder creates a new `RequestNewRound` instruction builder. @@ -37,7 +37,7 @@ func (inst *RequestNewRound) SetStateAccount(state ag_solanago.PublicKey) *Reque // GetStateAccount gets the "state" account. func (inst *RequestNewRound) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *RequestNewRound) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *RequestNewRound) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *RequestNewRound) SetAccessControllerAccount(accessController ag_sola // GetAccessControllerAccount gets the "accessController" account. func (inst *RequestNewRound) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst RequestNewRound) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *RequestNewRound) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/ocr2/RequestNewRound_test.go b/contracts/generated/ocr2/RequestNewRound_test.go index fa5cd68a3..16ba010d8 100644 --- a/contracts/generated/ocr2/RequestNewRound_test.go +++ b/contracts/generated/ocr2/RequestNewRound_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/SetBilling.go b/contracts/generated/ocr2/SetBilling.go index ba9e79ce9..6cf6fa07e 100644 --- a/contracts/generated/ocr2/SetBilling.go +++ b/contracts/generated/ocr2/SetBilling.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -21,18 +21,20 @@ type SetBilling struct { // // [2] = [] accessController // - // [3] = [WRITE] tokenVault + // [3] = [WRITE] tokenReceiver // - // [4] = [] vaultAuthority + // [4] = [WRITE] tokenVault // - // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + // [5] = [] vaultAuthority + // + // [6] = [] tokenProgram + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSetBillingInstructionBuilder creates a new `SetBilling` instruction builder. func NewSetBillingInstructionBuilder() *SetBilling { nd := &SetBilling{ - AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 6), + AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 7), } return nd } @@ -57,7 +59,7 @@ func (inst *SetBilling) SetStateAccount(state ag_solanago.PublicKey) *SetBilling // GetStateAccount gets the "state" account. func (inst *SetBilling) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -68,7 +70,7 @@ func (inst *SetBilling) SetAuthorityAccount(authority ag_solanago.PublicKey) *Se // GetAuthorityAccount gets the "authority" account. func (inst *SetBilling) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -79,40 +81,51 @@ func (inst *SetBilling) SetAccessControllerAccount(accessController ag_solanago. // GetAccessControllerAccount gets the "accessController" account. func (inst *SetBilling) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] +} + +// SetTokenReceiverAccount sets the "tokenReceiver" account. +func (inst *SetBilling) SetTokenReceiverAccount(tokenReceiver ag_solanago.PublicKey) *SetBilling { + inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenReceiver).WRITE() + return inst +} + +// GetTokenReceiverAccount gets the "tokenReceiver" account. +func (inst *SetBilling) GetTokenReceiverAccount() *ag_solanago.AccountMeta { + return inst.AccountMetaSlice[3] } // SetTokenVaultAccount sets the "tokenVault" account. func (inst *SetBilling) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey) *SetBilling { - inst.AccountMetaSlice[3] = ag_solanago.Meta(tokenVault).WRITE() + inst.AccountMetaSlice[4] = ag_solanago.Meta(tokenVault).WRITE() return inst } // GetTokenVaultAccount gets the "tokenVault" account. func (inst *SetBilling) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[4] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. func (inst *SetBilling) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *SetBilling { - inst.AccountMetaSlice[4] = ag_solanago.Meta(vaultAuthority) + inst.AccountMetaSlice[5] = ag_solanago.Meta(vaultAuthority) return inst } // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *SetBilling) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[5] } // SetTokenProgramAccount sets the "tokenProgram" account. func (inst *SetBilling) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *SetBilling { - inst.AccountMetaSlice[5] = ag_solanago.Meta(tokenProgram) + inst.AccountMetaSlice[6] = ag_solanago.Meta(tokenProgram) return inst } // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *SetBilling) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[6] } func (inst SetBilling) Build() *Instruction { @@ -155,12 +168,15 @@ func (inst *SetBilling) Validate() error { return errors.New("accounts.AccessController is not set") } if inst.AccountMetaSlice[3] == nil { - return errors.New("accounts.TokenVault is not set") + return errors.New("accounts.TokenReceiver is not set") } if inst.AccountMetaSlice[4] == nil { - return errors.New("accounts.VaultAuthority is not set") + return errors.New("accounts.TokenVault is not set") } if inst.AccountMetaSlice[5] == nil { + return errors.New("accounts.VaultAuthority is not set") + } + if inst.AccountMetaSlice[6] == nil { return errors.New("accounts.TokenProgram is not set") } } @@ -182,13 +198,14 @@ func (inst *SetBilling) EncodeToTree(parent ag_treeout.Branches) { }) // Accounts of the instruction: - instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) + instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" tokenReceiver", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) }) }) }) @@ -230,6 +247,7 @@ func NewSetBillingInstruction( state ag_solanago.PublicKey, authority ag_solanago.PublicKey, accessController ag_solanago.PublicKey, + tokenReceiver ag_solanago.PublicKey, tokenVault ag_solanago.PublicKey, vaultAuthority ag_solanago.PublicKey, tokenProgram ag_solanago.PublicKey) *SetBilling { @@ -239,6 +257,7 @@ func NewSetBillingInstruction( SetStateAccount(state). SetAuthorityAccount(authority). SetAccessControllerAccount(accessController). + SetTokenReceiverAccount(tokenReceiver). SetTokenVaultAccount(tokenVault). SetVaultAuthorityAccount(vaultAuthority). SetTokenProgramAccount(tokenProgram) diff --git a/contracts/generated/ocr2/SetBillingAccessController.go b/contracts/generated/ocr2/SetBillingAccessController.go index 34b0392ac..89017f089 100644 --- a/contracts/generated/ocr2/SetBillingAccessController.go +++ b/contracts/generated/ocr2/SetBillingAccessController.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -18,7 +18,7 @@ type SetBillingAccessController struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSetBillingAccessControllerInstructionBuilder creates a new `SetBillingAccessController` instruction builder. @@ -37,7 +37,7 @@ func (inst *SetBillingAccessController) SetStateAccount(state ag_solanago.Public // GetStateAccount gets the "state" account. func (inst *SetBillingAccessController) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *SetBillingAccessController) SetAuthorityAccount(authority ag_solanag // GetAuthorityAccount gets the "authority" account. func (inst *SetBillingAccessController) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *SetBillingAccessController) SetAccessControllerAccount(accessControl // GetAccessControllerAccount gets the "accessController" account. func (inst *SetBillingAccessController) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst SetBillingAccessController) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *SetBillingAccessController) EncodeToTree(parent ag_treeout.Branches) // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/ocr2/SetBillingAccessController_test.go b/contracts/generated/ocr2/SetBillingAccessController_test.go index 4d73910ac..2c6efde1f 100644 --- a/contracts/generated/ocr2/SetBillingAccessController_test.go +++ b/contracts/generated/ocr2/SetBillingAccessController_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/SetBilling_test.go b/contracts/generated/ocr2/SetBilling_test.go index 84882d6a7..e4d00c397 100644 --- a/contracts/generated/ocr2/SetBilling_test.go +++ b/contracts/generated/ocr2/SetBilling_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/SetRequesterAccessController.go b/contracts/generated/ocr2/SetRequesterAccessController.go index f80a34a49..f9587dc70 100644 --- a/contracts/generated/ocr2/SetRequesterAccessController.go +++ b/contracts/generated/ocr2/SetRequesterAccessController.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -18,7 +18,7 @@ type SetRequesterAccessController struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSetRequesterAccessControllerInstructionBuilder creates a new `SetRequesterAccessController` instruction builder. @@ -37,7 +37,7 @@ func (inst *SetRequesterAccessController) SetStateAccount(state ag_solanago.Publ // GetStateAccount gets the "state" account. func (inst *SetRequesterAccessController) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *SetRequesterAccessController) SetAuthorityAccount(authority ag_solan // GetAuthorityAccount gets the "authority" account. func (inst *SetRequesterAccessController) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *SetRequesterAccessController) SetAccessControllerAccount(accessContr // GetAccessControllerAccount gets the "accessController" account. func (inst *SetRequesterAccessController) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst SetRequesterAccessController) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *SetRequesterAccessController) EncodeToTree(parent ag_treeout.Branche // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/ocr2/SetRequesterAccessController_test.go b/contracts/generated/ocr2/SetRequesterAccessController_test.go index c2965c0b2..ae14b2453 100644 --- a/contracts/generated/ocr2/SetRequesterAccessController_test.go +++ b/contracts/generated/ocr2/SetRequesterAccessController_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/TransferOwnership.go b/contracts/generated/ocr2/TransferOwnership.go index de8bb5511..8168fd378 100644 --- a/contracts/generated/ocr2/TransferOwnership.go +++ b/contracts/generated/ocr2/TransferOwnership.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -17,7 +17,7 @@ type TransferOwnership struct { // [0] = [WRITE] state // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewTransferOwnershipInstructionBuilder creates a new `TransferOwnership` instruction builder. @@ -42,7 +42,7 @@ func (inst *TransferOwnership) SetStateAccount(state ag_solanago.PublicKey) *Tra // GetStateAccount gets the "state" account. func (inst *TransferOwnership) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *TransferOwnership) SetAuthorityAccount(authority ag_solanago.PublicK // GetAuthorityAccount gets the "authority" account. func (inst *TransferOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst TransferOwnership) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *TransferOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/TransferOwnership_test.go b/contracts/generated/ocr2/TransferOwnership_test.go index 580f53962..2bbdd9fb1 100644 --- a/contracts/generated/ocr2/TransferOwnership_test.go +++ b/contracts/generated/ocr2/TransferOwnership_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/TransferPayeeship.go b/contracts/generated/ocr2/TransferPayeeship.go index f24cc2708..1eb5e1bb7 100644 --- a/contracts/generated/ocr2/TransferPayeeship.go +++ b/contracts/generated/ocr2/TransferPayeeship.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -22,7 +22,7 @@ type TransferPayeeship struct { // [3] = [] payee // // [4] = [] proposedPayee - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewTransferPayeeshipInstructionBuilder creates a new `TransferPayeeship` instruction builder. @@ -41,7 +41,7 @@ func (inst *TransferPayeeship) SetStateAccount(state ag_solanago.PublicKey) *Tra // GetStateAccount gets the "state" account. func (inst *TransferPayeeship) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -52,7 +52,7 @@ func (inst *TransferPayeeship) SetAuthorityAccount(authority ag_solanago.PublicK // GetAuthorityAccount gets the "authority" account. func (inst *TransferPayeeship) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetTransmitterAccount sets the "transmitter" account. @@ -63,7 +63,7 @@ func (inst *TransferPayeeship) SetTransmitterAccount(transmitter ag_solanago.Pub // GetTransmitterAccount gets the "transmitter" account. func (inst *TransferPayeeship) GetTransmitterAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } // SetPayeeAccount sets the "payee" account. @@ -74,7 +74,7 @@ func (inst *TransferPayeeship) SetPayeeAccount(payee ag_solanago.PublicKey) *Tra // GetPayeeAccount gets the "payee" account. func (inst *TransferPayeeship) GetPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[3] } // SetProposedPayeeAccount sets the "proposedPayee" account. @@ -85,7 +85,7 @@ func (inst *TransferPayeeship) SetProposedPayeeAccount(proposedPayee ag_solanago // GetProposedPayeeAccount gets the "proposedPayee" account. func (inst *TransferPayeeship) GetProposedPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[4] } func (inst TransferPayeeship) Build() *Instruction { @@ -140,11 +140,11 @@ func (inst *TransferPayeeship) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=5]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice.Get(4))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" transmitter", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta("proposedPayee", inst.AccountMetaSlice[4])) }) }) }) diff --git a/contracts/generated/ocr2/TransferPayeeship_test.go b/contracts/generated/ocr2/TransferPayeeship_test.go index 76c4e0427..1928c73c2 100644 --- a/contracts/generated/ocr2/TransferPayeeship_test.go +++ b/contracts/generated/ocr2/TransferPayeeship_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/WithdrawFunds.go b/contracts/generated/ocr2/WithdrawFunds.go index c667b4ef4..c2f8629a3 100644 --- a/contracts/generated/ocr2/WithdrawFunds.go +++ b/contracts/generated/ocr2/WithdrawFunds.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -27,7 +27,7 @@ type WithdrawFunds struct { // [5] = [WRITE] recipient // // [6] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewWithdrawFundsInstructionBuilder creates a new `WithdrawFunds` instruction builder. @@ -52,7 +52,7 @@ func (inst *WithdrawFunds) SetStateAccount(state ag_solanago.PublicKey) *Withdra // GetStateAccount gets the "state" account. func (inst *WithdrawFunds) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -63,7 +63,7 @@ func (inst *WithdrawFunds) SetAuthorityAccount(authority ag_solanago.PublicKey) // GetAuthorityAccount gets the "authority" account. func (inst *WithdrawFunds) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -74,7 +74,7 @@ func (inst *WithdrawFunds) SetAccessControllerAccount(accessController ag_solana // GetAccessControllerAccount gets the "accessController" account. func (inst *WithdrawFunds) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } // SetTokenVaultAccount sets the "tokenVault" account. @@ -85,7 +85,7 @@ func (inst *WithdrawFunds) SetTokenVaultAccount(tokenVault ag_solanago.PublicKey // GetTokenVaultAccount gets the "tokenVault" account. func (inst *WithdrawFunds) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[3] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -96,7 +96,7 @@ func (inst *WithdrawFunds) SetVaultAuthorityAccount(vaultAuthority ag_solanago.P // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *WithdrawFunds) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[4] } // SetRecipientAccount sets the "recipient" account. @@ -107,7 +107,7 @@ func (inst *WithdrawFunds) SetRecipientAccount(recipient ag_solanago.PublicKey) // GetRecipientAccount gets the "recipient" account. func (inst *WithdrawFunds) GetRecipientAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[5] } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -118,7 +118,7 @@ func (inst *WithdrawFunds) SetTokenProgramAccount(tokenProgram ag_solanago.Publi // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *WithdrawFunds) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(6) + return inst.AccountMetaSlice[6] } func (inst WithdrawFunds) Build() *Instruction { @@ -188,13 +188,13 @@ func (inst *WithdrawFunds) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=7]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta(" recipient", inst.AccountMetaSlice.Get(5))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(6))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" vaultAuthority", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" recipient", inst.AccountMetaSlice[5])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[6])) }) }) }) diff --git a/contracts/generated/ocr2/WithdrawFunds_test.go b/contracts/generated/ocr2/WithdrawFunds_test.go index 6c5cc6b04..e7644d18d 100644 --- a/contracts/generated/ocr2/WithdrawFunds_test.go +++ b/contracts/generated/ocr2/WithdrawFunds_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/WithdrawPayment.go b/contracts/generated/ocr2/WithdrawPayment.go index b62568460..f8b1fefab 100644 --- a/contracts/generated/ocr2/WithdrawPayment.go +++ b/contracts/generated/ocr2/WithdrawPayment.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -24,7 +24,7 @@ type WithdrawPayment struct { // [4] = [WRITE] payee // // [5] = [] tokenProgram - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewWithdrawPaymentInstructionBuilder creates a new `WithdrawPayment` instruction builder. @@ -43,7 +43,7 @@ func (inst *WithdrawPayment) SetStateAccount(state ag_solanago.PublicKey) *Withd // GetStateAccount gets the "state" account. func (inst *WithdrawPayment) GetStateAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -54,7 +54,7 @@ func (inst *WithdrawPayment) SetAuthorityAccount(authority ag_solanago.PublicKey // GetAuthorityAccount gets the "authority" account. func (inst *WithdrawPayment) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetTokenVaultAccount sets the "tokenVault" account. @@ -65,7 +65,7 @@ func (inst *WithdrawPayment) SetTokenVaultAccount(tokenVault ag_solanago.PublicK // GetTokenVaultAccount gets the "tokenVault" account. func (inst *WithdrawPayment) GetTokenVaultAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } // SetVaultAuthorityAccount sets the "vaultAuthority" account. @@ -76,7 +76,7 @@ func (inst *WithdrawPayment) SetVaultAuthorityAccount(vaultAuthority ag_solanago // GetVaultAuthorityAccount gets the "vaultAuthority" account. func (inst *WithdrawPayment) GetVaultAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[3] } // SetPayeeAccount sets the "payee" account. @@ -87,7 +87,7 @@ func (inst *WithdrawPayment) SetPayeeAccount(payee ag_solanago.PublicKey) *Withd // GetPayeeAccount gets the "payee" account. func (inst *WithdrawPayment) GetPayeeAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(4) + return inst.AccountMetaSlice[4] } // SetTokenProgramAccount sets the "tokenProgram" account. @@ -98,7 +98,7 @@ func (inst *WithdrawPayment) SetTokenProgramAccount(tokenProgram ag_solanago.Pub // GetTokenProgramAccount gets the "tokenProgram" account. func (inst *WithdrawPayment) GetTokenProgramAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(5) + return inst.AccountMetaSlice[5] } func (inst WithdrawPayment) Build() *Instruction { @@ -156,12 +156,12 @@ func (inst *WithdrawPayment) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=6]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice.Get(3))) - accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice.Get(4))) - accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(5))) + accountsBranch.Child(ag_format.Meta(" state", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" tokenVault", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("vaultAuthority", inst.AccountMetaSlice[3])) + accountsBranch.Child(ag_format.Meta(" payee", inst.AccountMetaSlice[4])) + accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice[5])) }) }) }) diff --git a/contracts/generated/ocr2/WithdrawPayment_test.go b/contracts/generated/ocr2/WithdrawPayment_test.go index 0e3d5a85e..f2d9e624f 100644 --- a/contracts/generated/ocr2/WithdrawPayment_test.go +++ b/contracts/generated/ocr2/WithdrawPayment_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/WriteOffchainConfig.go b/contracts/generated/ocr2/WriteOffchainConfig.go index 17c098171..4606ce8cd 100644 --- a/contracts/generated/ocr2/WriteOffchainConfig.go +++ b/contracts/generated/ocr2/WriteOffchainConfig.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "errors" @@ -17,7 +17,7 @@ type WriteOffchainConfig struct { // [0] = [WRITE] proposal // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewWriteOffchainConfigInstructionBuilder creates a new `WriteOffchainConfig` instruction builder. @@ -42,7 +42,7 @@ func (inst *WriteOffchainConfig) SetProposalAccount(proposal ag_solanago.PublicK // GetProposalAccount gets the "proposal" account. func (inst *WriteOffchainConfig) GetProposalAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *WriteOffchainConfig) SetAuthorityAccount(authority ag_solanago.Publi // GetAuthorityAccount gets the "authority" account. func (inst *WriteOffchainConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst WriteOffchainConfig) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *WriteOffchainConfig) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" proposal", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/ocr2/WriteOffchainConfig_test.go b/contracts/generated/ocr2/WriteOffchainConfig_test.go index 16b8aed1a..8a9c917e1 100644 --- a/contracts/generated/ocr2/WriteOffchainConfig_test.go +++ b/contracts/generated/ocr2/WriteOffchainConfig_test.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/accounts.go b/contracts/generated/ocr2/accounts.go index 724fd9e16..71627c0d9 100644 --- a/contracts/generated/ocr2/accounts.go +++ b/contracts/generated/ocr2/accounts.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "fmt" diff --git a/contracts/generated/ocr2/instructions.go b/contracts/generated/ocr2/instructions.go index 2dc0c1598..c38fde6db 100644 --- a/contracts/generated/ocr2/instructions.go +++ b/contracts/generated/ocr2/instructions.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/testing_utils.go b/contracts/generated/ocr2/testing_utils.go index 4e270a6ed..3b5eb4e93 100644 --- a/contracts/generated/ocr2/testing_utils.go +++ b/contracts/generated/ocr2/testing_utils.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( "bytes" diff --git a/contracts/generated/ocr2/types.go b/contracts/generated/ocr2/types.go index ae5c1a040..53906e7fc 100644 --- a/contracts/generated/ocr2/types.go +++ b/contracts/generated/ocr2/types.go @@ -1,6 +1,6 @@ // Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. -package ocr2 +package ocr_2 import ( ag_binary "github.com/gagliardetto/binary" diff --git a/contracts/generated/store/AcceptFeedOwnership.go b/contracts/generated/store/AcceptFeedOwnership.go index 2e4515863..8c958bebb 100644 --- a/contracts/generated/store/AcceptFeedOwnership.go +++ b/contracts/generated/store/AcceptFeedOwnership.go @@ -18,7 +18,7 @@ type AcceptFeedOwnership struct { // [1] = [] proposedOwner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAcceptFeedOwnershipInstructionBuilder creates a new `AcceptFeedOwnership` instruction builder. @@ -37,7 +37,7 @@ func (inst *AcceptFeedOwnership) SetFeedAccount(feed ag_solanago.PublicKey) *Acc // GetFeedAccount gets the "feed" account. func (inst *AcceptFeedOwnership) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetProposedOwnerAccount sets the "proposedOwner" account. @@ -48,7 +48,7 @@ func (inst *AcceptFeedOwnership) SetProposedOwnerAccount(proposedOwner ag_solana // GetProposedOwnerAccount gets the "proposedOwner" account. func (inst *AcceptFeedOwnership) GetProposedOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAuthorityAccount sets the "authority" account. @@ -59,7 +59,7 @@ func (inst *AcceptFeedOwnership) SetAuthorityAccount(authority ag_solanago.Publi // GetAuthorityAccount gets the "authority" account. func (inst *AcceptFeedOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst AcceptFeedOwnership) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *AcceptFeedOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("proposedOwner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("proposedOwner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/store/AcceptStoreOwnership.go b/contracts/generated/store/AcceptStoreOwnership.go index 346da347e..b7176ddbc 100644 --- a/contracts/generated/store/AcceptStoreOwnership.go +++ b/contracts/generated/store/AcceptStoreOwnership.go @@ -16,7 +16,7 @@ type AcceptStoreOwnership struct { // [0] = [WRITE] store // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewAcceptStoreOwnershipInstructionBuilder creates a new `AcceptStoreOwnership` instruction builder. @@ -35,7 +35,7 @@ func (inst *AcceptStoreOwnership) SetStoreAccount(store ag_solanago.PublicKey) * // GetStoreAccount gets the "store" account. func (inst *AcceptStoreOwnership) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -46,7 +46,7 @@ func (inst *AcceptStoreOwnership) SetAuthorityAccount(authority ag_solanago.Publ // GetAuthorityAccount gets the "authority" account. func (inst *AcceptStoreOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst AcceptStoreOwnership) Build() *Instruction { @@ -92,8 +92,8 @@ func (inst *AcceptStoreOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/store/CloseFeed.go b/contracts/generated/store/CloseFeed.go index f64dfcd77..bf411b454 100644 --- a/contracts/generated/store/CloseFeed.go +++ b/contracts/generated/store/CloseFeed.go @@ -20,7 +20,7 @@ type CloseFeed struct { // [2] = [WRITE] receiver // // [3] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewCloseFeedInstructionBuilder creates a new `CloseFeed` instruction builder. @@ -39,7 +39,7 @@ func (inst *CloseFeed) SetFeedAccount(feed ag_solanago.PublicKey) *CloseFeed { // GetFeedAccount gets the "feed" account. func (inst *CloseFeed) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -50,7 +50,7 @@ func (inst *CloseFeed) SetOwnerAccount(owner ag_solanago.PublicKey) *CloseFeed { // GetOwnerAccount gets the "owner" account. func (inst *CloseFeed) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetReceiverAccount sets the "receiver" account. @@ -61,7 +61,7 @@ func (inst *CloseFeed) SetReceiverAccount(receiver ag_solanago.PublicKey) *Close // GetReceiverAccount gets the "receiver" account. func (inst *CloseFeed) GetReceiverAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } // SetAuthorityAccount sets the "authority" account. @@ -72,7 +72,7 @@ func (inst *CloseFeed) SetAuthorityAccount(authority ag_solanago.PublicKey) *Clo // GetAuthorityAccount gets the "authority" account. func (inst *CloseFeed) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[3] } func (inst CloseFeed) Build() *Instruction { @@ -124,10 +124,10 @@ func (inst *CloseFeed) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" receiver", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[3])) }) }) }) diff --git a/contracts/generated/store/CreateFeed.go b/contracts/generated/store/CreateFeed.go index d6aa494a2..20aecbd83 100644 --- a/contracts/generated/store/CreateFeed.go +++ b/contracts/generated/store/CreateFeed.go @@ -20,7 +20,7 @@ type CreateFeed struct { // [0] = [WRITE] feed // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewCreateFeedInstructionBuilder creates a new `CreateFeed` instruction builder. @@ -63,7 +63,7 @@ func (inst *CreateFeed) SetFeedAccount(feed ag_solanago.PublicKey) *CreateFeed { // GetFeedAccount gets the "feed" account. func (inst *CreateFeed) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -74,7 +74,7 @@ func (inst *CreateFeed) SetAuthorityAccount(authority ag_solanago.PublicKey) *Cr // GetAuthorityAccount gets the "authority" account. func (inst *CreateFeed) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst CreateFeed) Build() *Instruction { @@ -141,8 +141,8 @@ func (inst *CreateFeed) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/store/Initialize.go b/contracts/generated/store/Initialize.go index fc0430fe9..bf45fc7a6 100644 --- a/contracts/generated/store/Initialize.go +++ b/contracts/generated/store/Initialize.go @@ -18,7 +18,7 @@ type Initialize struct { // [1] = [SIGNER] owner // // [2] = [] loweringAccessController - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewInitializeInstructionBuilder creates a new `Initialize` instruction builder. @@ -37,7 +37,7 @@ func (inst *Initialize) SetStoreAccount(store ag_solanago.PublicKey) *Initialize // GetStoreAccount gets the "store" account. func (inst *Initialize) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -48,7 +48,7 @@ func (inst *Initialize) SetOwnerAccount(owner ag_solanago.PublicKey) *Initialize // GetOwnerAccount gets the "owner" account. func (inst *Initialize) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetLoweringAccessControllerAccount sets the "loweringAccessController" account. @@ -59,7 +59,7 @@ func (inst *Initialize) SetLoweringAccessControllerAccount(loweringAccessControl // GetLoweringAccessControllerAccount gets the "loweringAccessController" account. func (inst *Initialize) GetLoweringAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst Initialize) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *Initialize) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("loweringAccessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("loweringAccessController", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/store/LowerFlag.go b/contracts/generated/store/LowerFlag.go index 19b0656b8..4e634b4ec 100644 --- a/contracts/generated/store/LowerFlag.go +++ b/contracts/generated/store/LowerFlag.go @@ -20,7 +20,7 @@ type LowerFlag struct { // [2] = [SIGNER] authority // // [3] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewLowerFlagInstructionBuilder creates a new `LowerFlag` instruction builder. @@ -39,7 +39,7 @@ func (inst *LowerFlag) SetFeedAccount(feed ag_solanago.PublicKey) *LowerFlag { // GetFeedAccount gets the "feed" account. func (inst *LowerFlag) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -50,7 +50,7 @@ func (inst *LowerFlag) SetOwnerAccount(owner ag_solanago.PublicKey) *LowerFlag { // GetOwnerAccount gets the "owner" account. func (inst *LowerFlag) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAuthorityAccount sets the "authority" account. @@ -61,7 +61,7 @@ func (inst *LowerFlag) SetAuthorityAccount(authority ag_solanago.PublicKey) *Low // GetAuthorityAccount gets the "authority" account. func (inst *LowerFlag) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } // SetAccessControllerAccount sets the "accessController" account. @@ -72,7 +72,7 @@ func (inst *LowerFlag) SetAccessControllerAccount(accessController ag_solanago.P // GetAccessControllerAccount gets the "accessController" account. func (inst *LowerFlag) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(3) + return inst.AccountMetaSlice[3] } func (inst LowerFlag) Build() *Instruction { @@ -124,10 +124,10 @@ func (inst *LowerFlag) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=4]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(2))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(3))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[2])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[3])) }) }) }) diff --git a/contracts/generated/store/Query.go b/contracts/generated/store/Query.go index dcda56832..01f11e98c 100644 --- a/contracts/generated/store/Query.go +++ b/contracts/generated/store/Query.go @@ -16,7 +16,7 @@ type Query struct { Scope Scope // [0] = [] feed - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewQueryInstructionBuilder creates a new `Query` instruction builder. @@ -41,7 +41,7 @@ func (inst *Query) SetFeedAccount(feed ag_solanago.PublicKey) *Query { // GetFeedAccount gets the "feed" account. func (inst *Query) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } func (inst Query) Build() *Instruction { @@ -93,7 +93,7 @@ func (inst *Query) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=1]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta("feed", inst.AccountMetaSlice.Get(0))) + accountsBranch.Child(ag_format.Meta("feed", inst.AccountMetaSlice[0])) }) }) }) @@ -104,22 +104,22 @@ func (obj Query) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { { tmp := scopeContainer{} switch realvalue := obj.Scope.(type) { - case *ScopeVersion: + case *Version: tmp.Enum = 0 tmp.Version = *realvalue - case *ScopeDecimals: + case *Decimals: tmp.Enum = 1 tmp.Decimals = *realvalue - case *ScopeDescription: + case *Description: tmp.Enum = 2 tmp.Description = *realvalue - case *ScopeRoundData: + case *RoundData: tmp.Enum = 3 tmp.RoundData = *realvalue - case *ScopeLatestRoundData: + case *LatestRoundData: tmp.Enum = 4 tmp.LatestRoundData = *realvalue - case *ScopeAggregator: + case *Aggregator: tmp.Enum = 5 tmp.Aggregator = *realvalue } @@ -140,17 +140,17 @@ func (obj *Query) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { } switch tmp.Enum { case 0: - obj.Scope = (*ScopeVersion)(&tmp.Enum) + obj.Scope = (*Version)(&tmp.Enum) case 1: - obj.Scope = (*ScopeDecimals)(&tmp.Enum) + obj.Scope = (*Decimals)(&tmp.Enum) case 2: - obj.Scope = (*ScopeDescription)(&tmp.Enum) + obj.Scope = (*Description)(&tmp.Enum) case 3: obj.Scope = &tmp.RoundData case 4: - obj.Scope = (*ScopeLatestRoundData)(&tmp.Enum) + obj.Scope = (*LatestRoundData)(&tmp.Enum) case 5: - obj.Scope = (*ScopeAggregator)(&tmp.Enum) + obj.Scope = (*Aggregator)(&tmp.Enum) default: return fmt.Errorf("unknown enum index: %v", tmp.Enum) } diff --git a/contracts/generated/store/SetLoweringAccessController.go b/contracts/generated/store/SetLoweringAccessController.go index e6f389e43..c31c1514d 100644 --- a/contracts/generated/store/SetLoweringAccessController.go +++ b/contracts/generated/store/SetLoweringAccessController.go @@ -18,7 +18,7 @@ type SetLoweringAccessController struct { // [1] = [SIGNER] authority // // [2] = [] accessController - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSetLoweringAccessControllerInstructionBuilder creates a new `SetLoweringAccessController` instruction builder. @@ -37,7 +37,7 @@ func (inst *SetLoweringAccessController) SetStoreAccount(store ag_solanago.Publi // GetStoreAccount gets the "store" account. func (inst *SetLoweringAccessController) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -48,7 +48,7 @@ func (inst *SetLoweringAccessController) SetAuthorityAccount(authority ag_solana // GetAuthorityAccount gets the "authority" account. func (inst *SetLoweringAccessController) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAccessControllerAccount sets the "accessController" account. @@ -59,7 +59,7 @@ func (inst *SetLoweringAccessController) SetAccessControllerAccount(accessContro // GetAccessControllerAccount gets the "accessController" account. func (inst *SetLoweringAccessController) GetAccessControllerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst SetLoweringAccessController) Build() *Instruction { @@ -108,9 +108,9 @@ func (inst *SetLoweringAccessController) EncodeToTree(parent ag_treeout.Branches // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" authority", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("accessController", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/store/SetValidatorConfig.go b/contracts/generated/store/SetValidatorConfig.go index 8dd28b3df..d3aa39c38 100644 --- a/contracts/generated/store/SetValidatorConfig.go +++ b/contracts/generated/store/SetValidatorConfig.go @@ -19,7 +19,7 @@ type SetValidatorConfig struct { // [1] = [] owner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSetValidatorConfigInstructionBuilder creates a new `SetValidatorConfig` instruction builder. @@ -44,7 +44,7 @@ func (inst *SetValidatorConfig) SetFeedAccount(feed ag_solanago.PublicKey) *SetV // GetFeedAccount gets the "feed" account. func (inst *SetValidatorConfig) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -55,7 +55,7 @@ func (inst *SetValidatorConfig) SetOwnerAccount(owner ag_solanago.PublicKey) *Se // GetOwnerAccount gets the "owner" account. func (inst *SetValidatorConfig) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAuthorityAccount sets the "authority" account. @@ -66,7 +66,7 @@ func (inst *SetValidatorConfig) SetAuthorityAccount(authority ag_solanago.Public // GetAuthorityAccount gets the "authority" account. func (inst *SetValidatorConfig) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst SetValidatorConfig) Build() *Instruction { @@ -124,9 +124,9 @@ func (inst *SetValidatorConfig) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/store/SetWriter.go b/contracts/generated/store/SetWriter.go index 008afbc90..4e70a5437 100644 --- a/contracts/generated/store/SetWriter.go +++ b/contracts/generated/store/SetWriter.go @@ -19,7 +19,7 @@ type SetWriter struct { // [1] = [] owner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSetWriterInstructionBuilder creates a new `SetWriter` instruction builder. @@ -44,7 +44,7 @@ func (inst *SetWriter) SetFeedAccount(feed ag_solanago.PublicKey) *SetWriter { // GetFeedAccount gets the "feed" account. func (inst *SetWriter) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -55,7 +55,7 @@ func (inst *SetWriter) SetOwnerAccount(owner ag_solanago.PublicKey) *SetWriter { // GetOwnerAccount gets the "owner" account. func (inst *SetWriter) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAuthorityAccount sets the "authority" account. @@ -66,7 +66,7 @@ func (inst *SetWriter) SetAuthorityAccount(authority ag_solanago.PublicKey) *Set // GetAuthorityAccount gets the "authority" account. func (inst *SetWriter) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst SetWriter) Build() *Instruction { @@ -124,9 +124,9 @@ func (inst *SetWriter) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/store/Submit.go b/contracts/generated/store/Submit.go index cb9d9feb8..85a44e116 100644 --- a/contracts/generated/store/Submit.go +++ b/contracts/generated/store/Submit.go @@ -17,7 +17,7 @@ type Submit struct { // [0] = [WRITE] feed // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewSubmitInstructionBuilder creates a new `Submit` instruction builder. @@ -42,7 +42,7 @@ func (inst *Submit) SetFeedAccount(feed ag_solanago.PublicKey) *Submit { // GetFeedAccount gets the "feed" account. func (inst *Submit) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *Submit) SetAuthorityAccount(authority ag_solanago.PublicKey) *Submit // GetAuthorityAccount gets the "authority" account. func (inst *Submit) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst Submit) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *Submit) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/store/TransferFeedOwnership.go b/contracts/generated/store/TransferFeedOwnership.go index c939afefa..e54eae85e 100644 --- a/contracts/generated/store/TransferFeedOwnership.go +++ b/contracts/generated/store/TransferFeedOwnership.go @@ -19,7 +19,7 @@ type TransferFeedOwnership struct { // [1] = [] owner // // [2] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewTransferFeedOwnershipInstructionBuilder creates a new `TransferFeedOwnership` instruction builder. @@ -44,7 +44,7 @@ func (inst *TransferFeedOwnership) SetFeedAccount(feed ag_solanago.PublicKey) *T // GetFeedAccount gets the "feed" account. func (inst *TransferFeedOwnership) GetFeedAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetOwnerAccount sets the "owner" account. @@ -55,7 +55,7 @@ func (inst *TransferFeedOwnership) SetOwnerAccount(owner ag_solanago.PublicKey) // GetOwnerAccount gets the "owner" account. func (inst *TransferFeedOwnership) GetOwnerAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } // SetAuthorityAccount sets the "authority" account. @@ -66,7 +66,7 @@ func (inst *TransferFeedOwnership) SetAuthorityAccount(authority ag_solanago.Pub // GetAuthorityAccount gets the "authority" account. func (inst *TransferFeedOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(2) + return inst.AccountMetaSlice[2] } func (inst TransferFeedOwnership) Build() *Instruction { @@ -124,9 +124,9 @@ func (inst *TransferFeedOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=3]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice.Get(1))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(2))) + accountsBranch.Child(ag_format.Meta(" feed", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta(" owner", inst.AccountMetaSlice[1])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[2])) }) }) }) diff --git a/contracts/generated/store/TransferStoreOwnership.go b/contracts/generated/store/TransferStoreOwnership.go index 2c7143dc4..b2d9bbcd0 100644 --- a/contracts/generated/store/TransferStoreOwnership.go +++ b/contracts/generated/store/TransferStoreOwnership.go @@ -17,7 +17,7 @@ type TransferStoreOwnership struct { // [0] = [WRITE] store // // [1] = [SIGNER] authority - ag_solanago.AccountMetaSlice `bin:"-"` + ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"` } // NewTransferStoreOwnershipInstructionBuilder creates a new `TransferStoreOwnership` instruction builder. @@ -42,7 +42,7 @@ func (inst *TransferStoreOwnership) SetStoreAccount(store ag_solanago.PublicKey) // GetStoreAccount gets the "store" account. func (inst *TransferStoreOwnership) GetStoreAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(0) + return inst.AccountMetaSlice[0] } // SetAuthorityAccount sets the "authority" account. @@ -53,7 +53,7 @@ func (inst *TransferStoreOwnership) SetAuthorityAccount(authority ag_solanago.Pu // GetAuthorityAccount gets the "authority" account. func (inst *TransferStoreOwnership) GetAuthorityAccount() *ag_solanago.AccountMeta { - return inst.AccountMetaSlice.Get(1) + return inst.AccountMetaSlice[1] } func (inst TransferStoreOwnership) Build() *Instruction { @@ -108,8 +108,8 @@ func (inst *TransferStoreOwnership) EncodeToTree(parent ag_treeout.Branches) { // Accounts of the instruction: instructionBranch.Child("Accounts[len=2]").ParentFunc(func(accountsBranch ag_treeout.Branches) { - accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(0))) - accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice.Get(1))) + accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice[0])) + accountsBranch.Child(ag_format.Meta("authority", inst.AccountMetaSlice[1])) }) }) }) diff --git a/contracts/generated/store/types.go b/contracts/generated/store/types.go index 65ae77070..84dc701f0 100644 --- a/contracts/generated/store/types.go +++ b/contracts/generated/store/types.go @@ -98,55 +98,55 @@ type Scope interface { type scopeContainer struct { Enum ag_binary.BorshEnum `borsh_enum:"true"` - Version ScopeVersion - Decimals ScopeDecimals - Description ScopeDescription - RoundData ScopeRoundData - LatestRoundData ScopeLatestRoundData - Aggregator ScopeAggregator + Version Version + Decimals Decimals + Description Description + RoundData RoundData + LatestRoundData LatestRoundData + Aggregator Aggregator } -type ScopeVersion uint8 +type Version uint8 -func (obj ScopeVersion) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj Version) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *ScopeVersion) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *Version) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *ScopeVersion) isScope() {} +func (_ *Version) isScope() {} -type ScopeDecimals uint8 +type Decimals uint8 -func (obj ScopeDecimals) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj Decimals) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *ScopeDecimals) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *Decimals) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *ScopeDecimals) isScope() {} +func (_ *Decimals) isScope() {} -type ScopeDescription uint8 +type Description uint8 -func (obj ScopeDescription) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj Description) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *ScopeDescription) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *Description) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *ScopeDescription) isScope() {} +func (_ *Description) isScope() {} -type ScopeRoundData struct { +type RoundData struct { RoundId uint32 } -func (obj ScopeRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj RoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { // Serialize `RoundId` param: err = encoder.Encode(obj.RoundId) if err != nil { @@ -155,7 +155,7 @@ func (obj ScopeRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err er return nil } -func (obj *ScopeRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *RoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { // Deserialize `RoundId`: err = decoder.Decode(&obj.RoundId) if err != nil { @@ -164,28 +164,28 @@ func (obj *ScopeRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err return nil } -func (_ *ScopeRoundData) isScope() {} +func (_ *RoundData) isScope() {} -type ScopeLatestRoundData uint8 +type LatestRoundData uint8 -func (obj ScopeLatestRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj LatestRoundData) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *ScopeLatestRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *LatestRoundData) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *ScopeLatestRoundData) isScope() {} +func (_ *LatestRoundData) isScope() {} -type ScopeAggregator uint8 +type Aggregator uint8 -func (obj ScopeAggregator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { +func (obj Aggregator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) { return nil } -func (obj *ScopeAggregator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { +func (obj *Aggregator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) { return nil } -func (_ *ScopeAggregator) isScope() {} +func (_ *Aggregator) isScope() {} diff --git a/gauntlet/packages/gauntlet-solana-contracts/artifacts/schemas/ocr2.json b/gauntlet/packages/gauntlet-solana-contracts/artifacts/schemas/ocr2.json index 3fcd087e2..a497d5053 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/artifacts/schemas/ocr2.json +++ b/gauntlet/packages/gauntlet-solana-contracts/artifacts/schemas/ocr2.json @@ -31,11 +31,6 @@ "isMut": false, "isSigner": false }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, { "name": "owner", "isMut": false, @@ -48,7 +43,7 @@ }, { "name": "tokenVault", - "isMut": true, + "isMut": false, "isSigner": false }, { @@ -65,26 +60,6 @@ "name": "billingAccessController", "isMut": false, "isSigner": false - }, - { - "name": "rent", - "isMut": false, - "isSigner": false - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "associatedTokenProgram", - "isMut": false, - "isSigner": false } ], "args": [ @@ -111,6 +86,11 @@ "isMut": true, "isSigner": false }, + { + "name": "tokenReceiver", + "isMut": true, + "isSigner": false + }, { "name": "authority", "isMut": false, @@ -268,6 +248,11 @@ "isMut": true, "isSigner": false }, + { + "name": "tokenReceiver", + "isMut": true, + "isSigner": false + }, { "name": "authority", "isMut": false, @@ -343,12 +328,6 @@ { "name": "tokenMint", "type": "publicKey" - }, - { - "name": "payees", - "type": { - "vec": "publicKey" - } } ] }, @@ -433,6 +412,11 @@ "isMut": false, "isSigner": false }, + { + "name": "tokenReceiver", + "isMut": true, + "isSigner": false + }, { "name": "tokenVault", "isMut": true, @@ -560,6 +544,11 @@ "isMut": false, "isSigner": false }, + { + "name": "tokenReceiver", + "isMut": true, + "isSigner": false + }, { "name": "tokenVault", "isMut": true, diff --git a/tests/e2e/common/common.go b/tests/e2e/common/common.go index e200f2f5a..037b0c96d 100644 --- a/tests/e2e/common/common.go +++ b/tests/e2e/common/common.go @@ -171,7 +171,7 @@ func OffChainConfigParamsFromNodes(nodes []*client.Chainlink, nkb []NodeKeysBund if faultyNodes == 0 { faultyNodes = 1 } - log.Warn().Int("Nodes", faultyNodes).Msg("Faulty nodes") + log.Debug().Int("Nodes", faultyNodes).Msg("Faulty nodes") return contracts.OffChainAggregatorV2Config{ DeltaProgress: 2 * time.Second, DeltaResend: 5 * time.Second, diff --git a/tests/e2e/solclient/deployer.go b/tests/e2e/solclient/deployer.go index 26d791a64..8c181ed1f 100644 --- a/tests/e2e/solclient/deployer.go +++ b/tests/e2e/solclient/deployer.go @@ -69,7 +69,7 @@ func (c *ContractDeployer) GenerateAuthorities(seeds []string) error { // addMintInstr adds instruction for creating new mint (token) func (c *ContractDeployer) addMintInstr(instr *[]solana.Instruction) error { - accInstr, err := c.Client.CreateAccInstr(c.Accounts.Mint, TokenMintAccountSize, token.ProgramID) + accInstr, err := c.Client.CreateAccInstr(c.Accounts.Mint.PublicKey(), TokenMintAccountSize, token.ProgramID) if err != nil { return err } @@ -86,8 +86,40 @@ func (c *ContractDeployer) addMintInstr(instr *[]solana.Instruction) error { return nil } +func (c *ContractDeployer) SetupAssociatedAccount() (*solana.PublicKey, *solana.PublicKey, error) { + vault := c.Accounts.Authorities["vault"] + payer := c.Client.DefaultWallet + instr := make([]solana.Instruction, 0) + ainstr := associatedtokenaccount.NewCreateInstruction( + c.Client.DefaultWallet.PublicKey(), + vault.PublicKey, + c.Accounts.Mint.PublicKey(), + ).Build() + aaccount := ainstr.Impl.(associatedtokenaccount.Create).AccountMetaSlice[1].PublicKey + instr = append(instr, + ainstr, + ) + c.Accounts.OCRVaultAssociatedPubKey = aaccount + err := c.Client.TXSync( + "Setup associated account", + rpc.CommitmentFinalized, + instr, + func(key solana.PublicKey) *solana.PrivateKey { + if key.Equals(payer.PublicKey()) { + return &payer.PrivateKey + } + return nil + }, + payer.PublicKey(), + ) + if err != nil { + return nil, nil, err + } + return &aaccount, &vault.PublicKey, err +} + // AddNewAssociatedAccInstr adds instruction to create new account associated with some mint (token) -func (c *ContractDeployer) AddNewAssociatedAccInstr(acc *solana.Wallet, ownerPubKey solana.PublicKey, instr *[]solana.Instruction) error { +func (c *ContractDeployer) AddNewAssociatedAccInstr(acc solana.PublicKey, ownerPubKey solana.PublicKey, assocAccount solana.PublicKey, instr *[]solana.Instruction) error { accInstr, err := c.Client.CreateAccInstr(acc, TokenAccountSize, token.ProgramID) if err != nil { return err @@ -95,14 +127,14 @@ func (c *ContractDeployer) AddNewAssociatedAccInstr(acc *solana.Wallet, ownerPub *instr = append(*instr, accInstr, token.NewInitializeAccountInstruction( - acc.PublicKey(), + acc, c.Accounts.Mint.PublicKey(), ownerPubKey, solana.SysVarRentPubkey, ).Build(), associatedtokenaccount.NewCreateInstruction( c.Client.DefaultWallet.PublicKey(), - acc.PublicKey(), + assocAccount, c.Accounts.Mint.PublicKey(), ).Build(), ) @@ -112,7 +144,7 @@ func (c *ContractDeployer) AddNewAssociatedAccInstr(acc *solana.Wallet, ownerPub func (c *ContractDeployer) DeployOCRv2Store(billingAC string) (*Store, error) { programWallet := c.Client.ProgramWallets["store-keypair.json"] payer := c.Client.DefaultWallet - accInstruction, err := c.Client.CreateAccInstr(c.Accounts.Store, StoreAccountSize, programWallet.PublicKey()) + accInstruction, err := c.Client.CreateAccInstr(c.Accounts.Store.PublicKey(), StoreAccountSize, programWallet.PublicKey()) if err != nil { return nil, err } @@ -160,7 +192,7 @@ func (c *ContractDeployer) DeployOCRv2Store(billingAC string) (*Store, error) { func (c *ContractDeployer) CreateFeed(desc string, decimals uint8, granularity int, liveLength int) error { payer := c.Client.DefaultWallet programWallet := c.Client.ProgramWallets["store-keypair.json"] - feedAccInstruction, err := c.Client.CreateAccInstr(c.Accounts.Feed, OCRTransmissionsAccountSize, programWallet.PublicKey()) + feedAccInstruction, err := c.Client.CreateAccInstr(c.Accounts.Feed.PublicKey(), OCRTransmissionsAccountSize, programWallet.PublicKey()) if err != nil { return err } @@ -198,11 +230,11 @@ func (c *ContractDeployer) CreateFeed(desc string, decimals uint8, granularity i return nil } -func (c *ContractDeployer) addMintToAccInstr(instr *[]solana.Instruction, dest *solana.Wallet, amount uint64) error { +func (c *ContractDeployer) addMintToAccInstr(instr *[]solana.Instruction, dest solana.PublicKey, amount uint64) error { *instr = append(*instr, token.NewMintToInstruction( amount, c.Accounts.Mint.PublicKey(), - dest.PublicKey(), + dest, c.Accounts.MintAuthority.PublicKey(), nil, ).Build()) @@ -250,7 +282,7 @@ func (c *ContractDeployer) DeployLinkTokenContract() (*LinkToken, error) { func (c *ContractDeployer) InitOCR2(billingControllerAddr string, requesterControllerAddr string) (*OCRv2, error) { programWallet := c.Client.ProgramWallets["ocr2-keypair.json"] payer := c.Client.DefaultWallet - ocrAccInstruction, err := c.Client.CreateAccInstr(c.Accounts.OCR, OCRAccountSize, programWallet.PublicKey()) + ocrAccInstruction, err := c.Client.CreateAccInstr(c.Accounts.OCR.PublicKey(), OCRAccountSize, programWallet.PublicKey()) if err != nil { return nil, err } @@ -262,42 +294,31 @@ func (c *ContractDeployer) InitOCR2(billingControllerAddr string, requesterContr if err != nil { return nil, err } - vault := c.Accounts.Authorities["vault"] - vaultAssoc, _, err := solana.FindAssociatedTokenAddress(vault.PublicKey, c.Accounts.Mint.PublicKey()) + assocVault, vault, err := c.SetupAssociatedAccount() if err != nil { return nil, err } instr := make([]solana.Instruction, 0) - if err = c.AddNewAssociatedAccInstr(c.Accounts.OCRVault, vault.PublicKey, &instr); err != nil { - return nil, err - } - if err = c.addMintToAccInstr(&instr, c.Accounts.OCRVault, 1e8); err != nil { - return nil, err - } - instr = append(instr, ocrAccInstruction) - instr = append(instr, ocr_2.NewInitializeInstructionBuilder(). - SetMinAnswer(ag_binary.Int128{ - Lo: 1, - Hi: 0, - }). - SetMaxAnswer(ag_binary.Int128{ - Lo: 1000000, - Hi: 0, - }). - SetStateAccount(c.Accounts.OCR.PublicKey()). - SetFeedAccount(c.Accounts.Feed.PublicKey()). - SetPayerAccount(payer.PublicKey()). - SetOwnerAccount(c.Accounts.Owner.PublicKey()). - SetTokenMintAccount(c.Accounts.Mint.PublicKey()). - SetTokenVaultAccount(vaultAssoc). - SetVaultAuthorityAccount(vault.PublicKey). - SetRequesterAccessControllerAccount(racPubKey). - SetBillingAccessControllerAccount(bacPubKey). - SetRentAccount(solana.SysVarRentPubkey). - SetSystemProgramAccount(solana.SystemProgramID). - SetTokenProgramAccount(solana.TokenProgramID). - SetAssociatedTokenProgramAccount(solana.SPLAssociatedTokenAccountProgramID). - Build()) + instr = append(instr, + ocrAccInstruction, + ocr_2.NewInitializeInstructionBuilder(). + SetMinAnswer(ag_binary.Int128{ + Lo: 1, + Hi: 0, + }). + SetMaxAnswer(ag_binary.Int128{ + Lo: 1000000, + Hi: 0, + }). + SetStateAccount(c.Accounts.OCR.PublicKey()). + SetFeedAccount(c.Accounts.Feed.PublicKey()). + SetOwnerAccount(c.Accounts.Owner.PublicKey()). + SetTokenMintAccount(c.Accounts.Mint.PublicKey()). + SetTokenVaultAccount(*assocVault). + SetVaultAuthorityAccount(*vault). + SetRequesterAccessControllerAccount(racPubKey). + SetBillingAccessControllerAccount(bacPubKey). + Build()) err = c.Client.TXSync( "Initializing OCRv2", rpc.CommitmentFinalized, @@ -315,12 +336,6 @@ func (c *ContractDeployer) InitOCR2(billingControllerAddr string, requesterContr if key.Equals(c.Accounts.OCRVault.PublicKey()) { return &c.Accounts.OCRVault.PrivateKey } - if key.Equals(c.Accounts.Mint.PublicKey()) { - return &c.Accounts.Mint.PrivateKey - } - if key.Equals(c.Accounts.MintAuthority.PublicKey()) { - return &c.Accounts.MintAuthority.PrivateKey - } return nil }, payer.PublicKey(), @@ -335,7 +350,7 @@ func (c *ContractDeployer) InitOCR2(billingControllerAddr string, requesterContr Authorities: c.Accounts.Authorities, Owner: c.Accounts.Owner, Proposal: c.Accounts.Proposal, - OCRVaultAssociatedPubKey: vaultAssoc, + OCRVaultAssociatedPubKey: *assocVault, Mint: c.Accounts.Mint, ProgramWallet: programWallet, }, nil @@ -367,7 +382,7 @@ func (c *ContractDeployer) DeployOCRv2AccessController() (*AccessController, err programWallet := c.Client.ProgramWallets["access_controller-keypair.json"] payer := c.Client.DefaultWallet stateAcc := solana.NewWallet() - accInstruction, err := c.Client.CreateAccInstr(stateAcc, AccessControllerStateAccountSize, programWallet.PublicKey()) + accInstruction, err := c.Client.CreateAccInstr(stateAcc.PublicKey(), AccessControllerStateAccountSize, programWallet.PublicKey()) if err != nil { return nil, err } diff --git a/tests/e2e/solclient/ocr2.go b/tests/e2e/solclient/ocr2.go index 767c8e1a8..5398f11f2 100644 --- a/tests/e2e/solclient/ocr2.go +++ b/tests/e2e/solclient/ocr2.go @@ -71,6 +71,7 @@ func (m *OCRv2) acceptProposal(digest []byte) error { m.State.PublicKey(), m.Proposal.PublicKey(), m.Owner.PublicKey(), + m.OCRVaultAssociatedPubKey, m.Owner.PublicKey(), m.OCRVaultAssociatedPubKey, va.PublicKey, @@ -93,6 +94,47 @@ func (m *OCRv2) acceptProposal(digest []byte) error { ) } +// SetBilling sets default billing to oracles +func (m *OCRv2) SetBilling(observationPayment uint32, transmissionPayment uint32, controllerAddr string) error { + payer := m.Client.DefaultWallet + billingACPubKey, err := solana.PublicKeyFromBase58(controllerAddr) + if err != nil { + return nil + } + va := m.ContractDeployer.Accounts.Authorities["vault"] + err = m.Client.TXSync( + "Set billing", + rpc.CommitmentConfirmed, + []solana.Instruction{ + ocr_2.NewSetBillingInstruction( + observationPayment, + transmissionPayment, + m.State.PublicKey(), + m.Owner.PublicKey(), + m.Owner.PublicKey(), + billingACPubKey, + m.OCRVaultAssociatedPubKey, // token vault + va.PublicKey, // vault authority + solana.TokenProgramID, // token program + ).Build(), + }, + func(key solana.PublicKey) *solana.PrivateKey { + if key.Equals(m.Owner.PublicKey()) { + return &m.Owner.PrivateKey + } + if key.Equals(payer.PublicKey()) { + return &payer.PrivateKey + } + return nil + }, + payer.PublicKey(), + ) + if err != nil { + return err + } + return nil +} + func (m *OCRv2) finalizeOffChainConfig() error { payer := m.Client.DefaultWallet return m.Client.TXSync( @@ -160,7 +202,7 @@ func (m *OCRv2) fetchProposalAccount() (*ocr_2.Proposal, error) { func (m *OCRv2) createProposal(version uint64) error { payer := m.Client.DefaultWallet programWallet := m.Client.ProgramWallets["ocr2-keypair.json"] - proposalAccInstruction, err := m.Client.CreateAccInstr(m.Proposal, OCRProposalAccountSize, programWallet.PublicKey()) + proposalAccInstruction, err := m.Client.CreateAccInstr(m.Proposal.PublicKey(), OCRProposalAccountSize, programWallet.PublicKey()) if err != nil { return err } @@ -251,46 +293,6 @@ func (m *OCRv2) DumpState() error { return nil } -// SetBilling sets default billing to oracles -func (m *OCRv2) SetBilling(observationPayment uint32, transmissionPayment uint32, controllerAddr string) error { - payer := m.Client.DefaultWallet - billingACPubKey, err := solana.PublicKeyFromBase58(controllerAddr) - if err != nil { - return nil - } - va := m.ContractDeployer.Accounts.Authorities["vault"] - err = m.Client.TXSync( - "Set billing", - rpc.CommitmentConfirmed, - []solana.Instruction{ - ocr_2.NewSetBillingInstruction( - observationPayment, - transmissionPayment, - m.State.PublicKey(), - m.Owner.PublicKey(), - billingACPubKey, - m.OCRVaultAssociatedPubKey, // token vault - va.PublicKey, // vault authority - solana.TokenProgramID, // token program - ).Build(), - }, - func(key solana.PublicKey) *solana.PrivateKey { - if key.Equals(m.Owner.PublicKey()) { - return &m.Owner.PrivateKey - } - if key.Equals(payer.PublicKey()) { - return &payer.PrivateKey - } - return nil - }, - payer.PublicKey(), - ) - if err != nil { - return err - } - return nil -} - func (m *OCRv2) GetContractData(ctx context.Context) (*contracts.OffchainAggregatorData, error) { panic("implement me") } @@ -343,8 +345,9 @@ func (m *OCRv2) proposeConfig(ocConfig contracts.OffChainAggregatorV2Config) err } // set one payee for all instr := make([]solana.Instruction, 0) + // TODO: get associated addr payee := solana.NewWallet() - if err := m.ContractDeployer.AddNewAssociatedAccInstr(payee, m.Owner.PublicKey(), &instr); err != nil { + if err := m.ContractDeployer.AddNewAssociatedAccInstr(payee.PublicKey(), m.Owner.PublicKey(), payee.PublicKey(), &instr); err != nil { return err } payees := make([]solana.PublicKey, 0) diff --git a/tests/e2e/solclient/solclient.go b/tests/e2e/solclient/solclient.go index 8ec96e94a..9cf23fa7c 100644 --- a/tests/e2e/solclient/solclient.go +++ b/tests/e2e/solclient/solclient.go @@ -3,16 +3,17 @@ package solclient import ( "context" "fmt" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "io/fs" "math/big" "os" "path/filepath" "time" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/gagliardetto/solana-go" "github.com/gagliardetto/solana-go/programs/system" "github.com/gagliardetto/solana-go/rpc" @@ -115,7 +116,7 @@ func NewClient(cfg *SolNetwork) (*Client, error) { } // CreateAccInstr creates instruction for account creation of particular size -func (c *Client) CreateAccInstr(acc *solana.Wallet, accSize uint64, ownerPubKey solana.PublicKey) (solana.Instruction, error) { +func (c *Client) CreateAccInstr(acc solana.PublicKey, accSize uint64, ownerPubKey solana.PublicKey) (solana.Instruction, error) { payer := c.DefaultWallet rentMin, err := c.RPC.GetMinimumBalanceForRentExemption( context.TODO(), @@ -130,7 +131,7 @@ func (c *Client) CreateAccInstr(acc *solana.Wallet, accSize uint64, ownerPubKey accSize, ownerPubKey, payer.PublicKey(), - acc.PublicKey(), + acc, ).Build(), nil } From 9b10bb754fc83fc1d04033a02146f70cea9f8625 Mon Sep 17 00:00:00 2001 From: Tate Date: Tue, 13 Sep 2022 15:38:24 -0600 Subject: [PATCH 40/47] go mod tidy --- go.mod | 1 - go.sum | 5 ----- 2 files changed, 6 deletions(-) diff --git a/go.mod b/go.mod index 3b268585a..68adc75c0 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/gagliardetto/treeout v0.1.4 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 - github.com/rs/zerolog v1.27.0 github.com/smartcontractkit/chainlink-relay v0.1.3 github.com/smartcontractkit/libocr v0.0.0-20220701150323-d815c8d0eab8 github.com/stretchr/testify v1.7.1 diff --git a/go.sum b/go.sum index 967c3bbae..96c655436 100644 --- a/go.sum +++ b/go.sum @@ -87,7 +87,6 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -130,7 +129,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -350,9 +348,6 @@ github.com/riferrei/srclient v0.4.1-0.20211229125508-8edc580da179 h1:eImEYUKu9U/ github.com/riferrei/srclient v0.4.1-0.20211229125508-8edc580da179/go.mod h1:vbkLmWcgYa7JgfPvuy/+K8fTS0p1bApqadxrxi/S1MI= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= From ccfe68c415a4541cda3ca4293c38a03fad7f4489 Mon Sep 17 00:00:00 2001 From: Tate Date: Tue, 13 Sep 2022 15:38:24 -0600 Subject: [PATCH 41/47] go mod tidy --- go.mod | 1 - go.sum | 5 ----- 2 files changed, 6 deletions(-) diff --git a/go.mod b/go.mod index 3b268585a..68adc75c0 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/gagliardetto/treeout v0.1.4 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 - github.com/rs/zerolog v1.27.0 github.com/smartcontractkit/chainlink-relay v0.1.3 github.com/smartcontractkit/libocr v0.0.0-20220701150323-d815c8d0eab8 github.com/stretchr/testify v1.7.1 diff --git a/go.sum b/go.sum index 967c3bbae..96c655436 100644 --- a/go.sum +++ b/go.sum @@ -87,7 +87,6 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -130,7 +129,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -350,9 +348,6 @@ github.com/riferrei/srclient v0.4.1-0.20211229125508-8edc580da179 h1:eImEYUKu9U/ github.com/riferrei/srclient v0.4.1-0.20211229125508-8edc580da179/go.mod h1:vbkLmWcgYa7JgfPvuy/+K8fTS0p1bApqadxrxi/S1MI= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= From e169f498bb0941e3058f20f538fb66b0c0cddfbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 15 Sep 2022 14:05:46 +0900 Subject: [PATCH 42/47] Replace clone() with to_account_info() --- contracts/programs/ocr2/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index eb93c6394..63455ebac 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -57,7 +57,7 @@ pub mod ocr2 { ctx.accounts.state.clone(), ctx.accounts.token_program.to_account_info(), ctx.accounts.token_vault.to_account_info(), - ctx.accounts.vault_authority.clone(), + ctx.accounts.vault_authority.to_account_info(), ctx.remaining_accounts, ctx.accounts.token_receiver.to_account_info(), )?; From 7d972796b8fab6619dc500faac4b607d48dc1711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 15 Sep 2022 14:11:09 +0900 Subject: [PATCH 43/47] Remove some comments --- contracts/programs/ocr2/src/context.rs | 7 ------- contracts/tests/ocr2.spec.ts | 5 ----- tests/e2e/solclient/ocr2.go | 1 - 3 files changed, 13 deletions(-) diff --git a/contracts/programs/ocr2/src/context.rs b/contracts/programs/ocr2/src/context.rs index 72ba92323..e367c4c26 100644 --- a/contracts/programs/ocr2/src/context.rs +++ b/contracts/programs/ocr2/src/context.rs @@ -14,8 +14,6 @@ pub struct Initialize<'info> { #[account(zero)] pub state: AccountLoader<'info, State>, pub feed: Account<'info, Transmissions>, - // #[account(mut)] - // pub payer: Signer<'info>, pub owner: Signer<'info>, pub token_mint: Account<'info, Mint>, @@ -30,11 +28,6 @@ pub struct Initialize<'info> { pub requester_access_controller: AccountLoader<'info, AccessController>, pub billing_access_controller: AccountLoader<'info, AccessController>, - // #[account(address = sysvar::rent::ID)] - // pub rent: Sysvar<'info, Rent>, - // pub system_program: Program<'info, System>, - // pub token_program: Program<'info, Token>, - // pub associated_token_program: Program<'info, AssociatedToken>, } #[derive(Accounts)] diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 6dfefae73..ad029745e 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -609,17 +609,12 @@ describe("ocr2", async () => { .accounts({ state: state.publicKey, feed: feed.publicKey, - // payer: provider.wallet.publicKey, owner: owner.publicKey, tokenMint: token, tokenVault: tokenVault, vaultAuthority: vaultAuthority, requesterAccessController: requesterAccessController.publicKey, billingAccessController: billingAccessController.publicKey, - // rent: SYSVAR_RENT_PUBKEY, - // systemProgram: SystemProgram.programId, - // tokenProgram: TOKEN_PROGRAM_ID, - // associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID, }) .signers([state]) .preInstructions([ diff --git a/tests/e2e/solclient/ocr2.go b/tests/e2e/solclient/ocr2.go index 5398f11f2..81f639f5c 100644 --- a/tests/e2e/solclient/ocr2.go +++ b/tests/e2e/solclient/ocr2.go @@ -363,7 +363,6 @@ func (m *OCRv2) proposeConfig(ocConfig contracts.OffChainAggregatorV2Config) err proposeInstr.Append(solana.Meta(payees[i])) } instr = append(instr, proposeInstr.Build()) - // TODO: how to set payees as remaining return m.Client.TXSync( "Set payees", rpc.CommitmentFinalized, From 4028ab0fcb773a61d72f36411895976d00fcd10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 15 Sep 2022 14:47:03 +0900 Subject: [PATCH 44/47] Only execute the token transfer if amount left is >0 --- contracts/programs/ocr2/src/lib.rs | 35 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 63455ebac..239e42c54 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -64,22 +64,25 @@ pub mod ocr2 { // Transfer out remaining balance from the token_vault let balance_gjuels = token::accessor::amount(&ctx.accounts.token_vault.to_account_info())?; - token::transfer( - CpiContext::new( - ctx.accounts.token_program.to_account_info(), - token::Transfer { - from: ctx.accounts.token_vault.to_account_info(), - to: ctx.accounts.token_receiver.to_account_info(), - authority: ctx.accounts.vault_authority.to_account_info(), - }, - ) - .with_signer(&[&[ - b"vault".as_ref(), - ctx.accounts.state.key().as_ref(), - &[ctx.accounts.state.load()?.vault_nonce], - ]]), - balance_gjuels, - )?; + + if balance_gjuels > 0 { + token::transfer( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + token::Transfer { + from: ctx.accounts.token_vault.to_account_info(), + to: ctx.accounts.token_receiver.to_account_info(), + authority: ctx.accounts.vault_authority.to_account_info(), + }, + ) + .with_signer(&[&[ + b"vault".as_ref(), + ctx.accounts.state.key().as_ref(), + &[ctx.accounts.state.load()?.vault_nonce], + ]]), + balance_gjuels, + )?; + } // NOTE: Close is handled by anchor on exit due to the `close` attribute Ok(()) From c84bc5484fb465e61ab6f214d9bf9095b6bc273b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 15 Sep 2022 14:48:02 +0900 Subject: [PATCH 45/47] gauntlet: Remove unused imports --- .../src/commands/contracts/ocr2/initialize.ts | 4 ++-- .../src/commands/contracts/token/transfer.ts | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts index 82c7391e2..fca5896e1 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/initialize.ts @@ -1,7 +1,7 @@ import { Result } from '@chainlink/gauntlet-core' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { Keypair, PublicKey, TransactionInstruction, SystemProgram, SYSVAR_RENT_PUBKEY } from '@solana/web3.js' -import { ASSOCIATED_TOKEN_PROGRAM_ID, getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token' +import { Keypair, PublicKey, TransactionInstruction, SystemProgram } from '@solana/web3.js' +import { getOrCreateAssociatedTokenAccount } from '@solana/spl-token' import { CONTRACT_LIST, getContract } from '../../../lib/contracts' import { utils } from '@project-serum/anchor' import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts index e85877a51..53b2a53e5 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/token/transfer.ts @@ -1,13 +1,8 @@ import { Result } from '@chainlink/gauntlet-core' -import { logger, BN, prompt } from '@chainlink/gauntlet-core/dist/utils' +import { logger, prompt } from '@chainlink/gauntlet-core/dist/utils' import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' -import { - ASSOCIATED_TOKEN_PROGRAM_ID, - createTransferInstruction, - getAssociatedTokenAddress, - TOKEN_PROGRAM_ID, -} from '@solana/spl-token' -import { PublicKey, TransactionInstruction } from '@solana/web3.js' +import { createTransferInstruction, getAssociatedTokenAddress } from '@solana/spl-token' +import { PublicKey } from '@solana/web3.js' import { TOKEN_DECIMALS } from '../../../lib/constants' import { CONTRACT_LIST } from '../../../lib/contracts' import { isValidTokenAccount } from './utils' From e3c4c3a3c8925c293605af59c823cfdc6f69862e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 16 Sep 2022 11:49:24 +0900 Subject: [PATCH 46/47] ts: Extract some constants --- contracts/examples/hello-world/tests/hello-world.ts | 7 +++++-- contracts/tests/ocr2.spec.ts | 10 +++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/contracts/examples/hello-world/tests/hello-world.ts b/contracts/examples/hello-world/tests/hello-world.ts index 6f8a84458..7a0bba28a 100644 --- a/contracts/examples/hello-world/tests/hello-world.ts +++ b/contracts/examples/hello-world/tests/hello-world.ts @@ -13,11 +13,13 @@ describe("hello-world", () => { const program = anchor.workspace.HelloWorld as Program; + const header = 8 + 192; // account discriminator + header + const transmissionSize = 48; + it("Is initialized!", async () => { const owner = provider.wallet; const store = anchor.web3.Keypair.generate(); const feed = anchor.web3.Keypair.generate(); - const accessController = anchor.web3.Keypair.generate(); let storeIdl = JSON.parse(fs.readFileSync("../../target/idl/store.json")); const storeProgram = new Program(storeIdl, CHAINLINK_PROGRAM_ID, provider); @@ -27,6 +29,7 @@ describe("hello-world", () => { const decimals = 18; const granularity = 30; const liveLength = 3; + const historicalLength = 3; await storeProgram.rpc.createFeed( description, decimals, @@ -41,7 +44,7 @@ describe("hello-world", () => { preInstructions: [ await storeProgram.account.transmissions.createInstruction( feed, - 8 + 192 + 6 * 24 + header + (liveLength + historicalLength) * transmissionSize ), ], } diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index ad029745e..07f285c6e 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -49,6 +49,9 @@ class Assignable { } class Round extends Assignable {} +const header = 8 + 192; // account discriminator + header +const transmissionSize = 48; + describe("ocr2", async () => { // Configure the client to use the local cluster. const provider = anchor.AnchorProvider.env(); @@ -356,6 +359,7 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; + const historicalLength = 3; await workspace.Store.methods .createFeed(description, decimals, granularity, liveLength) .accounts({ @@ -366,7 +370,7 @@ describe("ocr2", async () => { .preInstructions([ await workspace.Store.account.transmissions.createInstruction( feed, - 8 + 192 + 6 * 48 + header + (liveLength + historicalLength) * transmissionSize ), ]) .rpc(); @@ -1096,8 +1100,6 @@ describe("ocr2", async () => { const granularity = 30; const liveLength = 3; - const header = 8 + 192; // account discriminator + header - const transmissionSize = 48; const invalidLengths = [ header - 1, // insufficient for header size header + 6 * transmissionSize - 1, // incorrect size for ring buffer @@ -1138,8 +1140,6 @@ describe("ocr2", async () => { const granularity = 1; const liveLength = 3; - const header = 8 + 192; // account discriminator + header - const transmissionSize = 48; const feed = Keypair.generate(); const length = header + transmissionSize * liveLength; From 69d8cfd48626af971b57c336cf3df085863c1d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 16 Sep 2022 11:52:45 +0900 Subject: [PATCH 47/47] examples: Use up to date anchor client syntax --- .../examples/hello-world/tests/hello-world.ts | 59 ++++++++----------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/contracts/examples/hello-world/tests/hello-world.ts b/contracts/examples/hello-world/tests/hello-world.ts index 7a0bba28a..3e06f3071 100644 --- a/contracts/examples/hello-world/tests/hello-world.ts +++ b/contracts/examples/hello-world/tests/hello-world.ts @@ -21,7 +21,7 @@ describe("hello-world", () => { const store = anchor.web3.Keypair.generate(); const feed = anchor.web3.Keypair.generate(); - let storeIdl = JSON.parse(fs.readFileSync("../../target/idl/store.json")); + let storeIdl = JSON.parse(fs.readFileSync("../../target/idl/store.json", "utf-8")); const storeProgram = new Program(storeIdl, CHAINLINK_PROGRAM_ID, provider); // Create a feed @@ -30,58 +30,45 @@ describe("hello-world", () => { const granularity = 30; const liveLength = 3; const historicalLength = 3; - await storeProgram.rpc.createFeed( - description, - decimals, - granularity, - liveLength, - { - accounts: { - feed: feed.publicKey, - authority: owner.publicKey, - }, - signers: [feed], - preInstructions: [ - await storeProgram.account.transmissions.createInstruction( - feed, - header + (liveLength + historicalLength) * transmissionSize - ), - ], - } - ); - - await storeProgram.rpc.setWriter(owner.publicKey, { - accounts: { + await storeProgram.methods + .createFeed(description, decimals, granularity, liveLength) + .accounts({ feed: feed.publicKey, - owner: owner.publicKey, authority: owner.publicKey, - }, - }); + }) + .signers([feed]) + .preInstructions([ + await storeProgram.account.transmissions.createInstruction( + feed, + header + (liveLength + historicalLength) * transmissionSize + ), + ]).rpc(); + + await storeProgram.methods.setWriter(owner.publicKey).accounts({ + feed: feed.publicKey, + owner: owner.publicKey, + authority: owner.publicKey, + }).rpc(); const scale = new BN(10).pow(new BN(decimals)); // Scale answer to enough decimals let answer = new BN(1).mul(scale); let round = { timestamp: new BN(1), answer }; - let tx = await storeProgram.rpc.submit(round, { - accounts: { + let tx = await storeProgram.methods.submit(round).accounts({ store: store.publicKey, feed: feed.publicKey, authority: owner.publicKey, - }, - }); + }).rpc(); await provider.connection.confirmTransaction(tx); // Add your test here. - tx = await program.rpc.execute({ - accounts: { + tx = await program.methods.execute().accounts({ chainlinkFeed: feed.publicKey, chainlinkProgram: CHAINLINK_PROGRAM_ID, - }, - options: { commitment: "confirmed" }, - }); + }).rpc({ commitment: "confirmed" }); console.log("Your transaction signature", tx); - let t = await provider.connection.getConfirmedTransaction(tx, "confirmed"); + let t = await provider.connection.getTransaction(tx, { commitment: "confirmed" }); console.log(t.meta.logMessages); }); });