Skip to content

Commit

Permalink
fix networks
Browse files Browse the repository at this point in the history
  • Loading branch information
SWvheerden committed Mar 6, 2024
1 parent 6978595 commit 752db4f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion base_layer/tari_mining_helper_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ mod tests {
#[test]
fn check_inject_coinbase() {
unsafe {
let network = Network::get_current_or_user_setting_or_default();
let mut error = -1;
let error_ptr = &mut error as *mut c_int;
let header = BlockHeader::new(0);
Expand All @@ -814,7 +815,18 @@ mod tests {
let extra_string = CString::new("a").unwrap();
let extra_ptr: *const c_char = CString::into_raw(extra_string) as *const c_char;

inject_coinbase(byte_vec, 100, false, true, add_ptr, extra_ptr, 0x10, error_ptr);
inject_coinbase(
byte_vec,
100,
false,
true,
add_ptr,
extra_ptr,
network.as_byte() as u32,
error_ptr,
);

assert_eq!(error, 0);

let block_temp: NewBlockTemplate = BorshDeserialize::deserialize(&mut (*byte_vec).0.as_slice()).unwrap();

Expand Down

0 comments on commit 752db4f

Please sign in to comment.