mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 15:10:13 +00:00
new events
This commit is contained in:
@@ -260,3 +260,23 @@ event!(WithdrawEvent);
|
||||
event!(UncommitEvent);
|
||||
event!(MineEvent);
|
||||
event!(CloseEvent);
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use base64::{prelude::BASE64_STANDARD, Engine};
|
||||
|
||||
#[test]
|
||||
fn test_parse_commit_event() {
|
||||
// Create sample return data
|
||||
let data = "BQAAAAAAAAB9607Qp9I2VxNo2rSPHAz/tR2pJzGu9om7qHP71TpKqciMAwAAAAAAAAAAAAAAAAA2CwUAAAAAAADodkgXAAAAAAAAAAAAAAAAAAAAAAAAADYLBQAAAAAAAB7cDBcAAAAAypo7AAAAAMMQW2gAAAAA";
|
||||
let bytes = BASE64_STANDARD.decode(data).unwrap();
|
||||
|
||||
// Parse into CommitEvent
|
||||
let event: &SwapEvent = bytemuck::try_from_bytes(&bytes).unwrap();
|
||||
|
||||
// Verify fields
|
||||
println!("{:?}", event);
|
||||
assert!(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,8 @@ pub fn mine(signer: Pubkey, id: u64, amount: u64) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
// let [signer_info, block_info, commitment_info, market_info, miner_info, mint_info, permit_info, sender_info, system_program, token_program] =
|
||||
|
||||
pub fn commit(
|
||||
signer: Pubkey,
|
||||
amount: u64,
|
||||
|
||||
Reference in New Issue
Block a user