Compare commits
No commits in common. "00400c433dd8a584ef19af58fcab7fdd108d4110" and "586cb4646c119efbaf72e3642298ff4943879d25" have entirely different histories.
00400c433d
...
586cb4646c
2 changed files with 21 additions and 15 deletions
|
@ -1247,8 +1247,16 @@ pub extern "C" fn rust_wrapper_read_sapling_position(
|
|||
let wit_in: Vec<u8> = marshall_from_haskell_var(wit, wit_len, RW);
|
||||
let wit_reader = Cursor::new(wit_in);
|
||||
let iw: IncrementalWitness<Node, SAPLING_DEPTH> = read_incremental_witness(wit_reader).unwrap();
|
||||
let pos = iw.witnessed_position();
|
||||
let path = iw.path();
|
||||
match path {
|
||||
Some(p) => {
|
||||
let pos = p.position();
|
||||
return u64::from(pos);
|
||||
},
|
||||
None => {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
10
test/Spec.hs
10
test/Spec.hs
|
@ -1113,7 +1113,8 @@ main = do
|
|||
MainNet
|
||||
External
|
||||
p
|
||||
dn `shouldBe` Nothing
|
||||
dn `shouldNotBe` Nothing
|
||||
|
||||
describe "Generate an ExchangeAddress (MainNet) from transparent address" $ do
|
||||
let ta = decodeTransparentAddress "t1dMjvesbzdG41xgKaGU3HgwYJwSgbCK54e"
|
||||
it "Try to generate valid ExchangeAddress from Transparent Address" $ do
|
||||
|
@ -1121,12 +1122,9 @@ main = do
|
|||
Nothing -> assertFailure "Failed to decode transparent address"
|
||||
Just t -> do
|
||||
case (tr_type (ta_receiver t) ) of
|
||||
P2SH ->
|
||||
assertFailure
|
||||
"P2SH not supported for ExchengeAddress generation"
|
||||
P2SH -> assertFailure "P2SH not supported for ExchengeAddress generation"
|
||||
P2PKH -> do
|
||||
let exch =
|
||||
encodeExchangeAddress (ta_network t) (ta_receiver t)
|
||||
let exch = encodeExchangeAddress (ta_network t) (ta_receiver t)
|
||||
case exch of
|
||||
Nothing -> assertFailure "Failed to encode Exchange address"
|
||||
Just addr -> do
|
||||
|
|
Loading…
Reference in a new issue