RPC: Viewing Keys #113

Manually merged
pitmutt merged 173 commits from rav001 into milestone4 2025-01-14 19:53:29 +00:00
9 changed files with 46 additions and 15 deletions
Showing only changes of commit 60576016bf - Show all commits

3
.gitmodules vendored
View file

@ -1,4 +1,3 @@
[submodule "zcash-haskell"]
path = zcash-haskell
url = https://git.vergara.tech/Vergara_Tech/zcash-haskell.git
branch = master
url = https://code.vergara.tech/Vergara_Tech/zcash-haskell

View file

@ -5,6 +5,19 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.8.0.0-beta]
### Added
- RPC method `shieldnotes`
- RPC method `deshieldfunds`
## [0.7.2.0-beta]
### Fixed
- Creation of change addresses during account creation in GUI ([#111](https://code.vergara.tech/Vergara_Tech/zenith/issues/111))
## [0.7.1.0-beta]
### Changed

View file

@ -6,10 +6,10 @@ with-compiler: ghc-9.6.5
source-repository-package
type: git
location: https://git.vergara.tech/Vergara_Tech/haskell-hexstring.git
location: https://code.vergara.tech/Vergara_Tech/haskell-hexstring.git
tag: 39d8da7b11a80269454c2f134a5c834e0f3cb9a7
source-repository-package
type: git
location: https://git.vergara.tech/Vergara_Tech/haskell-foreign-rust.git
location: https://code.vergara.tech/Vergara_Tech/haskell-foreign-rust.git
tag: 335e804454cd30da2c526457be37e477f71e4665

View file

@ -530,7 +530,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
(str
" _____ _ _ _ \n|__ /___ _ __ (_) |_| |__\n / // _ \\ '_ \\| | __| '_ \\\n / /| __/ | | | | |_| | | |\n/____\\___|_| |_|_|\\__|_| |_|") <=>
C.hCenter
(withAttr titleAttr (str "Zcash Wallet v0.7.1.0-beta")) <=>
(withAttr titleAttr (str "Zcash Wallet v0.7.2.0-beta")) <=>
C.hCenter (withAttr blinkAttr $ str "Press any key..."))
else emptyWidget
capCommand3 :: String -> String -> String -> Widget Name

View file

@ -831,7 +831,7 @@ shieldTransparentNotes pool zHost zPort znet za bh = do
prepTSpends
(getTranSK $ zcashAccountTPrivateKey $ entityVal acc)
trNotes
chgAddr <- getInternalAddresses pool $ entityKey acc
chgAddr <- liftIO $ getInternalAddresses pool $ entityKey acc
let internalUA =
getUA $ walletAddressUAddress $ entityVal $ head chgAddr
let oRcvr =
@ -1142,7 +1142,7 @@ prepareTxV2 pool zebraHost zebraPort zn za bh pnotes policy = do
makeOutgoing acc recvs chg pol = do
let k = map (\(x, _, _, _) -> x) recvs
let j = map (\(_, _, x, _) -> x) recvs
chgAddr <- runNoLoggingT $ getInternalAddresses pool $ entityKey acc
chgAddr <- getInternalAddresses pool $ entityKey acc
let internalUA = getUA $ walletAddressUAddress $ entityVal $ head chgAddr
case pol of
Full ->
@ -1364,8 +1364,7 @@ syncWallet config w = do
mapM (liftIO . runNoLoggingT . getAddresses pool . entityKey) accs
logDebugN $ "addrs: " <> T.pack (show addrs)
intAddrs <-
concat <$>
mapM (liftIO . runNoLoggingT . getInternalAddresses pool . entityKey) accs
concat <$> mapM (liftIO . getInternalAddresses pool . entityKey) accs
chainTip <- liftIO $ getMaxBlock pool znet
logDebugN $ "chain tip: " <> T.pack (show chainTip)
lastBlock <- liftIO $ getLastSyncBlock pool $ entityKey w

View file

@ -648,8 +648,9 @@ getAddressById pool a = do
getInternalAddresses ::
ConnectionPool -- ^ The database path
-> ZcashAccountId -- ^ The account ID to check
-> NoLoggingT IO [Entity WalletAddress]
-> IO [Entity WalletAddress]
getInternalAddresses pool a =
runNoLoggingT $
PS.retryOnBusy $
flip PS.runSqlPool pool $ do
select $ do
@ -1437,7 +1438,8 @@ getWalletTransactions ::
-> NoLoggingT IO ()
getWalletTransactions pool w = do
let w' = entityVal w
chgAddr <- getInternalAddresses pool $ walletAddressAccId $ entityVal w
chgAddr <-
liftIO $ getInternalAddresses pool $ walletAddressAccId $ entityVal w
let ctReceiver = t_rec =<< readUnifiedAddressDB (entityVal $ head chgAddr)
let csReceiver = s_rec =<< readUnifiedAddressDB (entityVal $ head chgAddr)
let coReceiver = o_rec =<< readUnifiedAddressDB (entityVal $ head chgAddr)

View file

@ -89,6 +89,7 @@ data AppEvent
| MenuClicked
| NewClicked
| NewAddress !(Maybe (Entity ZcashAccount))
| NewInternalAddress !(Maybe (Entity ZcashAccount))
| NewAccount !(Maybe (Entity ZcashWallet))
| NewWallet
| SetPool !ZcashPool
@ -102,6 +103,7 @@ data AppEvent
| LoadAddrs ![Entity WalletAddress]
| LoadAccs ![Entity ZcashAccount]
| LoadWallets ![Entity ZcashWallet]
| CheckChange
| ConfirmCancel
| SaveAddress !(Maybe (Entity ZcashAccount))
| SaveAccount !(Maybe (Entity ZcashWallet))
@ -1200,6 +1202,7 @@ handleEvent wenv node model evt =
AccountClicked -> [Model $ model & accPopup .~ True]
MenuClicked -> [Model $ model & menuPopup .~ True]
NewClicked -> [Model $ model & newPopup .~ not (model ^. newPopup)]
NewInternalAddress acc -> [Task $ addNewAddress "Change" Internal acc]
NewAddress acc ->
[ Model $
model & confirmTitle ?~ "New Address" & confirmAccept .~ "Create" &
@ -1366,13 +1369,28 @@ handleEvent wenv node model evt =
, Event $ ShowMsg "Copied transaction ID!"
]
LoadTxs t -> [Model $ model & transactions .~ t]
CheckChange ->
[ Task $ do
case currentAccount of
Nothing -> return $ ShowError "No account available"
Just acc -> do
pool <-
runNoLoggingT $ initPool $ c_dbPath $ model ^. configuration
chgAddr <- getInternalAddresses pool $ entityKey acc
if not (null chgAddr)
then return $ SetPool OrchardPool
else return $ NewInternalAddress currentAccount
]
LoadAddrs a ->
if not (null a)
then [ Model $ model & addresses .~ a
, Event CheckChange
, Event $ SwitchAddr $ model ^. selAddr
, Event $ SetPool OrchardPool
]
else [Event $ NewAddress currentAccount]
else [ Event $ NewAddress currentAccount
, Event $ NewInternalAddress currentAccount
]
LoadAccs a ->
if not (null a)
then [Model $ model & accounts .~ a, Event $ SwitchAcc 0]
@ -1992,7 +2010,7 @@ runZenithGUI config = do
Left _e -> print "Zebra not available"
where
params hd =
[ appWindowTitle "Zenith - Zcash Full Node Wallet - 0.7.1.0-beta"
[ appWindowTitle "Zenith - Zcash Full Node Wallet - 0.7.2.0-beta"
, appWindowState $ MainWindowNormal (1000, 700)
, appTheme zenithTheme
, appFontDef

@ -1 +1 @@
Subproject commit 7d3ae36d2b48b8ed91a70e40a77fb7efe57765a0
Subproject commit a28edcb5995667677e96a08c6952a568bfd6c51e

View file

@ -1,6 +1,6 @@
cabal-version: 3.0
name: zenith
version: 0.7.1.0-beta
version: 0.7.2.0-beta
license: MIT
license-file: LICENSE
author: Rene Vergara