Skip to content

Commit

Permalink
move plans
Browse files Browse the repository at this point in the history
  • Loading branch information
abenso committed Nov 18, 2024
1 parent a32eadd commit f122a6f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 0 additions & 2 deletions app/rust/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ pub mod memo;
pub mod memo_plain_text;
pub mod nullifier;
pub mod rseed;
pub mod spend;
pub mod symmetric;
pub mod value;
pub mod output;

pub use error::ParserError;

Expand Down
16 changes: 9 additions & 7 deletions app/rust/src/parser/plans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@
use crate::parser::{
detection::DetectionDataPlanC,
memo::MemoPlanC,
spend::SpendPlanC,
action::ActionsHashC,
output::OutputPlanC,
};

use crate::keys::spend_key::SpendKeyBytes;
use crate::effect_hash::EffectHash;
use crate::parser::bytes::BytesC;
use crate::parser::parameters::TransactionParametersC;
use crate::ParserError;
use crate::constants::EFFECT_HASH_LEN;

pub mod output;
pub mod spend;

#[repr(C)]
#[cfg_attr(any(feature = "derive-debug", test), derive(Debug))]
pub struct TransactionPlanC {
Expand Down Expand Up @@ -88,7 +90,7 @@ pub unsafe extern "C" fn rs_compute_transaction_plan(
/// argument.
pub unsafe extern "C" fn rs_spend_action_hash(
sk: &SpendKeyBytes,
plan: &SpendPlanC,
plan: &spend::SpendPlanC,
output: *mut u8,
output_len: usize,
) -> u32 {
Expand Down Expand Up @@ -116,12 +118,12 @@ pub unsafe extern "C" fn rs_spend_action_hash(
/// argument.
pub unsafe extern "C" fn rs_output_action_hash(
sk: &SpendKeyBytes,
plan: &OutputPlanC,
plan: &output::OutputPlanC,
memo_key: &BytesC,
output: *mut u8,
output_len: usize,
) -> u32 {
crate::zlog("rs_spend_action_hash\x00");
crate::zlog("rs_output_action_hash\x00");
let output = std::slice::from_raw_parts_mut(output, output_len);

if output.len() < 64 {
Expand Down Expand Up @@ -301,7 +303,7 @@ mod tests {
let dummy_proof_blinding_s_bytes =
hex::decode("93043bfea2094b0398f0e14bccc66a9ec335bbfd1f8e8b4c2c21428947f5e50d")
.unwrap();
let dummy_action = SpendPlanC {
let dummy_action = spend::SpendPlanC {
note: dummy_note,
position: 131414504314097,
randomizer: BytesC::from_slice(&dummy_randomizer_bytes),
Expand Down Expand Up @@ -367,7 +369,7 @@ mod tests {
hex::decode("86ae5038cfd758ee6520792a143ea401ef8e2afbc70f65c0b6e1d58b3492b211")
.unwrap();

let dummy_action = OutputPlanC {
let dummy_action = output::OutputPlanC {
value: dummy_value,
dest_address: dummy_address,
rseed: BytesC::from_slice(&dummy_rseed_bytes),
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit f122a6f

Please sign in to comment.