Merge pull request 'Improve witness update functions.' (#94) from rav001 into milestone2
Reviewed-on: https://git.vergara.tech///Vergara_Tech/zcash-haskell/pulls/94
This commit is contained in:
commit
12296026a0
4 changed files with 21 additions and 7 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.0.2]
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Modified witness update functions to skip the process if no commitments are present
|
||||||
|
|
||||||
## [0.7.0.1]
|
## [0.7.0.1]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -229,9 +229,13 @@ getOrchardNotePosition =
|
||||||
-- | Update the witness of an Orchard note
|
-- | Update the witness of an Orchard note
|
||||||
updateOrchardWitness :: OrchardWitness -> [HexString] -> OrchardWitness
|
updateOrchardWitness :: OrchardWitness -> [HexString] -> OrchardWitness
|
||||||
updateOrchardWitness wit cmus =
|
updateOrchardWitness wit cmus =
|
||||||
OrchardWitness $
|
if not (null cmus)
|
||||||
|
then OrchardWitness $
|
||||||
withPureBorshVarBuffer $
|
withPureBorshVarBuffer $
|
||||||
rustWrapperUpdateOrchardWitness (toBytes $ orchWit wit) (map toBytes cmus)
|
rustWrapperUpdateOrchardWitness
|
||||||
|
(toBytes $ orchWit wit)
|
||||||
|
(map toBytes cmus)
|
||||||
|
else wit
|
||||||
|
|
||||||
-- | Parse a potential Zcash address
|
-- | Parse a potential Zcash address
|
||||||
parseAddress :: BS.ByteString -> Maybe ValidAddress
|
parseAddress :: BS.ByteString -> Maybe ValidAddress
|
||||||
|
|
|
@ -218,9 +218,13 @@ getSaplingNotePosition =
|
||||||
|
|
||||||
updateSaplingWitness :: SaplingWitness -> [HexString] -> SaplingWitness
|
updateSaplingWitness :: SaplingWitness -> [HexString] -> SaplingWitness
|
||||||
updateSaplingWitness wit cmus =
|
updateSaplingWitness wit cmus =
|
||||||
SaplingWitness $
|
if not (null cmus)
|
||||||
|
then SaplingWitness $
|
||||||
withPureBorshVarBuffer $
|
withPureBorshVarBuffer $
|
||||||
rustWrapperUpdateSaplingWitness (toBytes $ sapWit wit) (map toBytes cmus)
|
rustWrapperUpdateSaplingWitness
|
||||||
|
(toBytes $ sapWit wit)
|
||||||
|
(map toBytes cmus)
|
||||||
|
else wit
|
||||||
|
|
||||||
-- | Encode a SaplingReceiver into HRF text
|
-- | Encode a SaplingReceiver into HRF text
|
||||||
encodeSaplingAddress :: ZcashNet -> SaplingReceiver -> Maybe T.Text
|
encodeSaplingAddress :: ZcashNet -> SaplingReceiver -> Maybe T.Text
|
||||||
|
|
|
@ -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.0.1
|
version: 0.7.0.2
|
||||||
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