Compare commits
4 commits
9008010db7
...
ef8dba474e
Author | SHA1 | Date | |
---|---|---|---|
ef8dba474e | |||
b68ee96583 | |||
62cda9cc15 | |||
5ce149c54f |
5 changed files with 42 additions and 1 deletions
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.7.4.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `MerklePath`
|
||||||
|
|
||||||
## [0.7.3.0]
|
## [0.7.3.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -1542,6 +1542,25 @@ pub extern "C" fn rust_wrapper_update_sapling_witness(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn rust_wrapper_read_sapling_node(
|
||||||
|
cmu: *const u8,
|
||||||
|
cmu_len: usize,
|
||||||
|
out: *mut u8,
|
||||||
|
out_len: &mut usize
|
||||||
|
){
|
||||||
|
let node_in: Vec<u8> = marshall_from_haskell_var(cmu, cmu_len, RW);
|
||||||
|
let sapling_note_comm = SaplingNoteCommitment::from_bytes(&to_array(node_in));
|
||||||
|
if sapling_note_comm.is_some().into() {
|
||||||
|
let n = Node::from_cmu(&sapling_note_comm.unwrap());
|
||||||
|
let h = Hhex { bytes: n.to_bytes().to_vec()};
|
||||||
|
marshall_to_haskell_var(&h, out, out_len, RW);
|
||||||
|
} else {
|
||||||
|
let h0 = Hhex { bytes: vec![0] };
|
||||||
|
marshall_to_haskell_var(&h0, out, out_len, RW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn rust_wrapper_read_orchard_frontier(
|
pub extern "C" fn rust_wrapper_read_orchard_frontier(
|
||||||
tree: *const u8,
|
tree: *const u8,
|
||||||
|
|
|
@ -246,6 +246,13 @@ import ZcashHaskell.Types
|
||||||
-> `()'
|
-> `()'
|
||||||
#}
|
#}
|
||||||
|
|
||||||
|
{# fun unsafe rust_wrapper_read_sapling_node as rustWrapperReadSaplingNode
|
||||||
|
{ toBorshVar* `BS.ByteString'&
|
||||||
|
, getVarBuffer `Buffer HexString'&
|
||||||
|
}
|
||||||
|
-> `()'
|
||||||
|
#}
|
||||||
|
|
||||||
{# fun unsafe rust_wrapper_read_orchard_node as rustWrapperReadOrchardNode
|
{# fun unsafe rust_wrapper_read_orchard_node as rustWrapperReadOrchardNode
|
||||||
{ toBorshVar* `BS.ByteString'&
|
{ toBorshVar* `BS.ByteString'&
|
||||||
, getVarBuffer `Buffer HexString'&
|
, getVarBuffer `Buffer HexString'&
|
||||||
|
|
|
@ -22,6 +22,7 @@ import C.Zcash
|
||||||
, rustWrapperIsShielded
|
, rustWrapperIsShielded
|
||||||
, rustWrapperReadSaplingCommitmentTree
|
, rustWrapperReadSaplingCommitmentTree
|
||||||
, rustWrapperReadSaplingFrontier
|
, rustWrapperReadSaplingFrontier
|
||||||
|
, rustWrapperReadSaplingNode
|
||||||
, rustWrapperReadSaplingPosition
|
, rustWrapperReadSaplingPosition
|
||||||
, rustWrapperReadSaplingWitness
|
, rustWrapperReadSaplingWitness
|
||||||
, rustWrapperSaplingCheck
|
, rustWrapperSaplingCheck
|
||||||
|
@ -185,6 +186,14 @@ genSaplingInternalAddress sk =
|
||||||
res =
|
res =
|
||||||
withPureBorshVarBuffer (rustWrapperSaplingChgPaymentAddress $ getBytes sk)
|
withPureBorshVarBuffer (rustWrapperSaplingChgPaymentAddress $ getBytes sk)
|
||||||
|
|
||||||
|
getSaplingNodeValue :: BS.ByteString -> Maybe HexString
|
||||||
|
getSaplingNodeValue cmu =
|
||||||
|
if BS.length (hexBytes n) > 1
|
||||||
|
then Just n
|
||||||
|
else Nothing
|
||||||
|
where
|
||||||
|
n = withPureBorshVarBuffer $ rustWrapperReadSaplingNode cmu
|
||||||
|
|
||||||
getSaplingFrontier :: SaplingCommitmentTree -> Maybe SaplingFrontier
|
getSaplingFrontier :: SaplingCommitmentTree -> Maybe SaplingFrontier
|
||||||
getSaplingFrontier tree =
|
getSaplingFrontier tree =
|
||||||
if sf_pos updatedTree > 1
|
if sf_pos updatedTree > 1
|
||||||
|
|
|
@ -5,7 +5,7 @@ cabal-version: 3.0
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
name: zcash-haskell
|
name: zcash-haskell
|
||||||
version: 0.7.3.0
|
version: 0.7.4.0
|
||||||
synopsis: Utilities to interact with the Zcash blockchain
|
synopsis: Utilities to interact with the Zcash blockchain
|
||||||
description: Please see the README on the repo at <https://git.vergara.tech/Vergara_Tech/zcash-haskell#readme>
|
description: Please see the README on the repo at <https://git.vergara.tech/Vergara_Tech/zcash-haskell#readme>
|
||||||
category: Blockchain
|
category: Blockchain
|
||||||
|
|
Loading…
Reference in a new issue