mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 06:01:11 +00:00
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:
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user