From d6fafd5916e425171e25c0887f67318fd455dc0f Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 21 Nov 2022 11:19:24 -0500 Subject: [PATCH] fix(validator): idl and new id --- Anchor.toml.example | 2 + idl/validator.ts | 245 ++++++++++++++++++++++++++++++++++ programs/validator/src/lib.rs | 2 +- 3 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 idl/validator.ts diff --git a/Anchor.toml.example b/Anchor.toml.example index 18cf030..0ce1d09 100644 --- a/Anchor.toml.example +++ b/Anchor.toml.example @@ -5,6 +5,7 @@ squads_mpl = "84Ue9gKQUsStFJQCNQpsqvbceo7fKYSSCCMXxMZ5PkiW" program_manager = "8Y5Qbdb67Ka4LcPCziyhLrGbYN2ftZ1BG11Q5PiHenLP" mesh = "5mt41y2huXBXb8HSkMiNexABuk8GVEmrgZqEgauGtV4y" txmeta = "5o4wQhxotU8rVz6iK1VowzyX53z3HuznvhvYYCMZn875" +validator = "FnVHo2S6NxqaGT8buKCzxs8njaZEUkA9aRQNU87ASFyv" [programs.devnet] squads_mpl = "SMPLecH534NA9acpos4G6x7uf3LWbCAwZQE9e8ZekMu" @@ -23,6 +24,7 @@ squads_mpl = "SMPLecH534NA9acpos4G6x7uf3LWbCAwZQE9e8ZekMu" program_manager = "SMPLKTQhrgo22hFCVq2VGX1KAktTWjeizkhrdB1eauK" mesh = "SMPLVC8MxZ5Bf5EfF7PaMiTCxoBAcmkbM2vkrvMK8ho" txmeta = "SMPL5bz5ERMdweouWrXtk3jmb6FnjZkWf7pHDsE6Zwz" +validator = "SMPLbiNbsa19gf9jz8x9uHSvSn9VLFJB38dGy46kqJ7" [registry] url = "https://anchor.projectserum.com" diff --git a/idl/validator.ts b/idl/validator.ts new file mode 100644 index 0000000..e8ac9e1 --- /dev/null +++ b/idl/validator.ts @@ -0,0 +1,245 @@ +export type Validator = { + "version": "0.1.0", + "name": "validator", + "instructions": [ + { + "name": "createValidatorManager", + "accounts": [ + { + "name": "multisig", + "isMut": false, + "isSigner": false + }, + { + "name": "validatorManager", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "createManagedValidator", + "accounts": [ + { + "name": "multisig", + "isMut": false, + "isSigner": false + }, + { + "name": "validatorManager", + "isMut": true, + "isSigner": false + }, + { + "name": "managedValidator", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "validatorAddress", + "type": "publicKey" + }, + { + "name": "name", + "type": "string" + } + ] + } + ], + "accounts": [ + { + "name": "validatorManager", + "type": { + "kind": "struct", + "fields": [ + { + "name": "multisig", + "type": "publicKey" + }, + { + "name": "managedValidatorIndex", + "type": "u32" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "managedValidator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "managedValidatorIndex", + "type": "u32" + }, + { + "name": "validatorAddress", + "type": "publicKey" + }, + { + "name": "multisig", + "type": "publicKey" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] +}; + +export const IDL: Validator = { + "version": "0.1.0", + "name": "validator", + "instructions": [ + { + "name": "createValidatorManager", + "accounts": [ + { + "name": "multisig", + "isMut": false, + "isSigner": false + }, + { + "name": "validatorManager", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "createManagedValidator", + "accounts": [ + { + "name": "multisig", + "isMut": false, + "isSigner": false + }, + { + "name": "validatorManager", + "isMut": true, + "isSigner": false + }, + { + "name": "managedValidator", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "validatorAddress", + "type": "publicKey" + }, + { + "name": "name", + "type": "string" + } + ] + } + ], + "accounts": [ + { + "name": "validatorManager", + "type": { + "kind": "struct", + "fields": [ + { + "name": "multisig", + "type": "publicKey" + }, + { + "name": "managedValidatorIndex", + "type": "u32" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "managedValidator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "managedValidatorIndex", + "type": "u32" + }, + { + "name": "validatorAddress", + "type": "publicKey" + }, + { + "name": "multisig", + "type": "publicKey" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] +}; diff --git a/programs/validator/src/lib.rs b/programs/validator/src/lib.rs index 00db141..c9cfc26 100644 --- a/programs/validator/src/lib.rs +++ b/programs/validator/src/lib.rs @@ -4,7 +4,7 @@ use squads_mpl::state::*; use squads_mpl::errors::*; pub mod state; -declare_id!("FnVHo2S6NxqaGT8buKCzxs8njaZEUkA9aRQNU87ASFyv"); +declare_id!("SMPLbiNbsa19gf9jz8x9uHSvSn9VLFJB38dGy46kqJ7"); #[program] pub mod validator {