diff --git a/program/rust/src/instruction.rs b/program/rust/src/instruction.rs index c61cbda9..6205b78e 100644 --- a/program/rust/src/instruction.rs +++ b/program/rust/src/instruction.rs @@ -23,34 +23,36 @@ pub enum OracleCommand { /// Initialize first mapping list account // account[0] funding account [signer writable] // account[1] mapping account [signer writable] + // account[2] permissions account [] InitMapping = 0, - /// Initialize and add new mapping account - // account[0] funding account [signer writable] - // account[1] tail mapping account [signer writable] - // account[2] new mapping account [signer writable] + /// deprecated AddMapping = 1, /// Initialize and add new product reference data account // account[0] funding account [signer writable] // account[1] mapping account [signer writable] // account[2] new product account [signer writable] + // account[3] permissions account [] AddProduct = 2, /// Update product account // account[0] funding account [signer writable] // account[1] product account [signer writable] + // account[2] permissions account [] UpdProduct = 3, /// Add new price account to a product account - // account[0] funding account [signer writable] - // account[1] product account [writable] - // account[2] new price account [writable] - // account[3] permissions account [writable] + // account[0] funding account [signer writable] + // account[1] product account [writable] + // account[2] new price account [writable] + // account[3] permissions account [writable] AddPrice = 4, /// Add publisher to symbol account // account[0] funding account [signer writable] // account[1] price account [signer writable] + // account[2] permissions account [] AddPublisher = 5, /// Delete publisher from symbol account // account[0] funding account [signer writable] // account[1] price account [signer writable] + // account[2] permissions account [] DelPublisher = 6, /// Publish component price // account[0] funding account [signer writable] @@ -65,6 +67,7 @@ pub enum OracleCommand { /// (Re)initialize price account // account[0] funding account [signer writable] // account[1] new price account [signer writable] + // account[2] permissions account [] InitPrice = 9, /// deprecated InitTest = 10, @@ -73,41 +76,42 @@ pub enum OracleCommand { /// Set min publishers // account[0] funding account [signer writable] // account[1] price account [signer writable] + // account[2] permissions account [] SetMinPub = 12, /// Publish component price, never returning an error even if the update failed // account[0] funding account [signer writable] // account[1] price account [writable] // account[2] sysvar_clock account [] UpdPriceNoFailOnError = 13, - /// Resizes a price account so that it fits the Time Machine - // account[0] funding account [signer writable] - // account[1] price account [signer writable] - // account[2] system program [] + /// deprecated ResizePriceAccount = 14, /// Deletes a price account // account[0] funding account [signer writable] // account[1] product account [signer writable] // account[2] price account [signer writable] + // account[3] permissions account [] DelPrice = 15, /// Deletes a product account - // key[0] funding account [signer writable] - // key[1] mapping account [signer writable] - // key[2] product account [signer writable] + // account[0] funding account [signer writable] + // account[1] mapping account [signer writable] + // account[2] product account [signer writable] + // account[3] permissions account [] DelProduct = 16, /// Update authorities - // key[0] upgrade authority [signer writable] - // key[1] programdata account [] - // key[2] permissions account [writable] - // key[3] system program [] + // account[0] upgrade authority [signer writable] + // account[1] programdata account [] + // account[2] permissions account [writable] + // account[3] system program [] UpdPermissions = 17, /// Set max latency // account[0] funding account [signer writable] // account[1] price account [signer writable] + // account[2] permissions account [] SetMaxLatency = 18, /// Init price feed index - // account[0] funding account [signer writable] - // account[1] price account [writable] - // account[2] permissions account [writable] + // account[0] funding account [signer writable] + // account[1] price account [writable] + // account[2] permissions account [writable] InitPriceFeedIndex = 19, } diff --git a/program/rust/src/processor/add_product.rs b/program/rust/src/processor/add_product.rs index e953489f..eaf0b048 100644 --- a/program/rust/src/processor/add_product.rs +++ b/program/rust/src/processor/add_product.rs @@ -36,6 +36,7 @@ use { // account[0] funding account [signer writable] // account[1] mapping account [signer writable] // account[2] new product account [signer writable] +// account[3] permissions account [] pub fn add_product( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/add_publisher.rs b/program/rust/src/processor/add_publisher.rs index 13c29ea9..99601525 100644 --- a/program/rust/src/processor/add_publisher.rs +++ b/program/rust/src/processor/add_publisher.rs @@ -44,6 +44,7 @@ pub const DISABLE_ACCUMULATOR_V2: [u8; 32] = [ /// Add publisher to symbol account // account[0] funding account [signer writable] // account[1] price account [signer writable] +// account[2] permissions account [] pub fn add_publisher( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/del_price.rs b/program/rust/src/processor/del_price.rs index 92f3fe54..5c37f0ee 100644 --- a/program/rust/src/processor/del_price.rs +++ b/program/rust/src/processor/del_price.rs @@ -30,6 +30,7 @@ use { // account[0] funding account [signer writable] // account[1] product account [signer writable] // account[2] price account [signer writable] +// account[3] permissions account [] /// Warning: This function is dangerous and will break any programs that depend on the deleted /// price account! pub fn del_price( diff --git a/program/rust/src/processor/del_product.rs b/program/rust/src/processor/del_product.rs index c563207c..d1cbb8b7 100644 --- a/program/rust/src/processor/del_product.rs +++ b/program/rust/src/processor/del_product.rs @@ -36,9 +36,10 @@ use { /// little weird, as it allows you to construct a list of multiple mapping accounts where non-tail /// accounts have empty space. This is fine however; users should simply add new products to the /// first available spot. -// key[0] funding account [signer writable] -// key[1] mapping account [signer writable] -// key[2] product account [signer writable] +// account[0] funding account [signer writable] +// account[1] mapping account [signer writable] +// account[2] product account [signer writable] +// account[3] permissions account [] pub fn del_product( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/del_publisher.rs b/program/rust/src/processor/del_publisher.rs index cd9459f6..eae5fcb8 100644 --- a/program/rust/src/processor/del_publisher.rs +++ b/program/rust/src/processor/del_publisher.rs @@ -32,6 +32,7 @@ use { /// Delete publisher from symbol account // account[0] funding account [signer writable] // account[1] price account [signer writable] +// account[2] permissions account [] pub fn del_publisher( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/init_price.rs b/program/rust/src/processor/init_price.rs index b9f14656..1e19df82 100644 --- a/program/rust/src/processor/init_price.rs +++ b/program/rust/src/processor/init_price.rs @@ -32,6 +32,7 @@ use { /// (Re)initialize price account // account[0] funding account [signer writable] // account[1] new price account [signer writable] +// account[2] permissions account [] pub fn init_price( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/set_max_latency.rs b/program/rust/src/processor/set_max_latency.rs index 68a0b8fa..d6a39aa4 100644 --- a/program/rust/src/processor/set_max_latency.rs +++ b/program/rust/src/processor/set_max_latency.rs @@ -25,6 +25,7 @@ use { /// Set max latency // account[0] funding account [signer writable] // account[1] price account [signer writable] +// account[2] permissions account [] pub fn set_max_latency( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/set_min_pub.rs b/program/rust/src/processor/set_min_pub.rs index 55f1571d..90892686 100644 --- a/program/rust/src/processor/set_min_pub.rs +++ b/program/rust/src/processor/set_min_pub.rs @@ -25,6 +25,7 @@ use { /// Set min publishers // account[0] funding account [signer writable] // account[1] price account [signer writable] +// account[2] permissions account [] pub fn set_min_pub( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/upd_permissions.rs b/program/rust/src/processor/upd_permissions.rs index f4c2a43d..b49476d8 100644 --- a/program/rust/src/processor/upd_permissions.rs +++ b/program/rust/src/processor/upd_permissions.rs @@ -29,10 +29,10 @@ use { /// Updates permissions for the pyth oracle program /// This function can create and update the permissions accounts, which stores /// several public keys that can execute administrative instructions in the pyth program -// key[0] upgrade authority [signer writable] -// key[1] programdata account [] -// key[2] permissions account [writable] -// key[3] system program [] +// account[0] upgrade authority [signer writable] +// account[1] programdata account [] +// account[2] permissions account [writable] +// account[3] system program [] pub fn upd_permissions( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/program/rust/src/processor/upd_product.rs b/program/rust/src/processor/upd_product.rs index 4b44608a..bc184d7d 100644 --- a/program/rust/src/processor/upd_product.rs +++ b/program/rust/src/processor/upd_product.rs @@ -26,6 +26,7 @@ use { /// The metadata is provided as a list of key-value pairs at the end of the `instruction_data`. // account[0] funding account [signer writable] // account[1] product account [signer writable] +// account[2] permissions account [] pub fn upd_product( program_id: &Pubkey, accounts: &[AccountInfo],