refactor(twap_oracle): match instruction function order to Instruction enum

`idl-gen` emits IDL instructions in source order, and `spel` uses each
instruction's IDL position as its serde variant index. When the
`#[instruction]` function order diverges from the `twap_oracle_core::Instruction`
enum order, spel addresses the wrong instruction.

Move `update_current_tick` ahead of the TWAP-computation instruction so the
function order in twap_oracle.rs lines up with the enum variant order, and
regenerate artifacts/twap_oracle-idl.json to match.

No behavioral change — the instruction bodies are unchanged, only reordered.
This commit is contained in:
r4bbit
2026-06-30 15:13:47 +02:00
parent c8f061e4a8
commit c9fbb626ea
2 changed files with 57 additions and 57 deletions
+29 -29
View File
@@ -105,6 +105,35 @@
}
]
},
{
"name": "update_current_tick",
"accounts": [
{
"name": "current_tick_account",
"writable": true,
"signer": false,
"init": false
},
{
"name": "price_source",
"writable": false,
"signer": true,
"init": false
},
{
"name": "clock",
"writable": false,
"signer": false,
"init": false
}
],
"args": [
{
"name": "price",
"type": "u128"
}
]
},
{
"name": "publish_price",
"accounts": [
@@ -176,35 +205,6 @@
"type": "u64"
}
]
},
{
"name": "update_current_tick",
"accounts": [
{
"name": "current_tick_account",
"writable": true,
"signer": false,
"init": false
},
{
"name": "price_source",
"writable": false,
"signer": true,
"init": false
},
{
"name": "clock",
"writable": false,
"signer": false,
"init": false
}
],
"args": [
{
"name": "price",
"type": "u128"
}
]
}
],
"accounts": [