mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-15 07:26:45 +00:00
uncommit
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
mod close;
|
||||
mod commit;
|
||||
mod decommit;
|
||||
mod deposit;
|
||||
mod mine;
|
||||
mod open;
|
||||
mod swap;
|
||||
mod uncommit;
|
||||
mod withdraw;
|
||||
|
||||
use close::*;
|
||||
use commit::*;
|
||||
use decommit::*;
|
||||
use deposit::*;
|
||||
use mine::*;
|
||||
use open::*;
|
||||
use swap::*;
|
||||
use uncommit::*;
|
||||
use withdraw::*;
|
||||
|
||||
use ore_api::instruction::*;
|
||||
@@ -30,10 +30,10 @@ pub fn process_instruction(
|
||||
OreInstruction::Open => process_open(accounts, data)?,
|
||||
OreInstruction::Close => process_close(accounts, data)?,
|
||||
OreInstruction::Commit => process_commit(accounts, data)?,
|
||||
OreInstruction::Decommit => process_decommit(accounts, data)?,
|
||||
OreInstruction::Deposit => process_deposit(accounts, data)?,
|
||||
OreInstruction::Mine => process_mine(accounts, data)?,
|
||||
OreInstruction::Swap => process_swap(accounts, data)?,
|
||||
OreInstruction::Uncommit => process_uncommit(accounts, data)?,
|
||||
OreInstruction::Withdraw => process_withdraw(accounts, data)?,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use ore_api::prelude::*;
|
||||
use steel::*;
|
||||
|
||||
/// Decommit from a block.
|
||||
pub fn process_decommit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
|
||||
/// Uncommit from a block.
|
||||
pub fn process_uncommit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
|
||||
// Parse data.
|
||||
let args = Decommit::try_from_bytes(data)?;
|
||||
let args = Uncommit::try_from_bytes(data)?;
|
||||
let amount = u64::from_le_bytes(args.amount);
|
||||
|
||||
// Load accounts.
|
||||
Reference in New Issue
Block a user