Skip to content

Commit

Permalink
update go mod, rebase changes and minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon committed Feb 8, 2024
1 parent 691c79d commit cdfa6ed
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 74 deletions.
14 changes: 4 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dchest/blake2b v1.0.0 // indirect
github.com/dchest/siphash v1.2.3 // indirect
github.com/dcrlabs/neutrino-bch v0.0.0-20221031001408-f296bfa9bd1c // indirect
github.com/dcrlabs/bchwallet v0.0.0-20240114124852-0e95005810be // indirect
github.com/dcrlabs/neutrino-bch v0.0.0-20240114121828-d656bce11095 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/base58 v1.0.5 // indirect
github.com/decred/dcrd/blockchain/stake/v3 v3.0.0 // indirect
Expand Down Expand Up @@ -130,9 +131,6 @@ require (
github.com/gcash/bchd v0.19.0 // indirect
github.com/gcash/bchlog v0.0.0-20180913005452-b4f036f92fa6 // indirect
github.com/gcash/bchutil v0.0.0-20210113190856-6ea28dff4000 // indirect
github.com/gcash/bchwallet v0.10.0 // indirect
github.com/gcash/bchwallet/walletdb v0.0.0-20210524114850-4837f9798568 // indirect
github.com/gcash/neutrino v0.0.0-20210524114821-3b1878290cf9 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-chi/chi/v5 v5.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand All @@ -144,6 +142,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/trillian v1.4.1 // indirect
Expand Down Expand Up @@ -229,9 +228,4 @@ replace github.com/lib/pq => github.com/lib/pq v1.10.4
// github.com/btcsuite/btcwallet.
replace github.com/btcsuite/btcwallet v0.16.10-0.20230706223227-037580c66b74 => github.com/btcsuite/btcwallet v0.16.9

// github.com/ukane-philemon/dcrdex v0.0.0-20240126135833-b75c189e80a9 is the
// latest dcrdex master plus commits that adds methods required by
// cryptopower. This should be updated when these PRs get merged.
// 1. core: add ActiveOrders method to Core: https://github.com/decred/dcrdex/pull/2680
// 1. core: Add ExpiredBonds method to Core: https://github.com/decred/dcrdex/pull/2679
replace decred.org/dcrdex v0.6.3 => github.com/ukane-philemon/dcrdex v0.0.0-20240126135833-b75c189e80a9
replace decred.org/dcrdex v0.6.3 => github.com/decred/dcrdex v0.0.0-20240207234259-462dcb6e0736
62 changes: 7 additions & 55 deletions go.sum

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions libwallet/assets/dcr/dex_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ func (dw *DEXWallet) AddressPrivKey(ctx context.Context, addr stdaddr.Address) (
return privKey, err
}

func (dw *DEXWallet) ListSinceBlock(ctx context.Context, start, end, syncHeight int32) ([]walletjson.ListTransactionsResult, error) {
return dw.w.ListSinceBlock(ctx, start, end, syncHeight)
}

// Part of the Wallet interface.
func (dw *DEXWallet) Reconfigure(_ context.Context, _ *dexasset.WalletConfig, _ dex.Network, _ string) (restart bool, err error) {
return false, errors.New("Reconfigure not implemented by Cryptopower DEX wallet")
Expand Down
10 changes: 6 additions & 4 deletions ui/page/dcrdex/dcrdex_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ func (pg *DEXPage) Layout(gtx C) D {
msg = values.String(values.StrDexMainnetNotReady)
} else if !hasMultipleWallets {
msg = values.String(values.StrMultipleAssetRequiredMsg)
} else if !pg.AssetsManager.DEXCInitialized() || pg.CurrentPage() == nil {
} else if !pg.AssetsManager.DEXCInitialized() {
msg = values.String(values.StrDEXMsgAfterReset)
} else if pg.CurrentPage() == nil {
msg = values.String(values.StrDEXInitErrorMsg)
}

Expand Down Expand Up @@ -182,7 +184,7 @@ func (pg *DEXPage) OnNavigatedFrom() {}

// pendingBondConfirmation is a convenience function based on arbitrary
// heuristics to determine when to show bond confirmation step.
func pendingBondConfirmation(am *libwallet.AssetsManager, host string) (*core.Exchange, *core.BondAsset, *core.PendingBondState) {
func pendingBondConfirmation(am *libwallet.AssetsManager, host string) (string, *core.BondAsset, *core.PendingBondState) {
for _, xc := range am.DexClient().Exchanges() {
if (host != "" && xc.Host != host) || len(xc.Auth.PendingBonds) == 0 {
continue
Expand All @@ -191,9 +193,9 @@ func pendingBondConfirmation(am *libwallet.AssetsManager, host string) (*core.Ex
for _, bond := range xc.Auth.PendingBonds {
bondAsset := xc.BondAssets[bond.Symbol]
if bond.Confs < bondAsset.Confs {
return xc, bondAsset, bond
return xc.Host, bondAsset, bond
}
}
}
return nil, nil, nil
return "", nil, nil
}
4 changes: 2 additions & 2 deletions ui/page/dcrdex/dex_onboarding_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ func (pg *DEXOnboarding) waitForConfirmationAndListenForBlockNotifications() {
// host is optional.
func (pg *DEXOnboarding) checkForPendingBondPayment(host string) {
// Check if bond has already been posted but still pending confirmation.
xc, bondAsset, bond := pendingBondConfirmation(pg.AssetsManager, host)
xcHost, bondAsset, bond := pendingBondConfirmation(pg.AssetsManager, host)
if bond == nil {
return
}
Expand All @@ -1379,7 +1379,7 @@ func (pg *DEXOnboarding) checkForPendingBondPayment(host string) {
pg.bondServer.bondAssets = map[libutils.AssetType]*core.BondAsset{
bondAssetType: bondAsset,
}
pg.bondServer.url = xc.Host
pg.bondServer.url = xcHost
pg.bondSourceAccountSelector = components.NewWalletAndAccountSelector(pg.Load, bondAssetType)
ok := pg.bondSourceAccountSelector.SetSelectedAsset(bondAssetType)
if !ok { // impossible but can happen if user deletes wallet shortly after posting bonds.
Expand Down
6 changes: 5 additions & 1 deletion ui/values/localizable/en.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ const EN = `
"noSupportedBondAsset" = "DEX server (%s) does not support available asset wallets. Please choose another server."
"dexPassword" = "DCRDEX Password"
"insufficientBondAmount" = "Insufficient funds in this account, you need a minimum of %v to post bond."
"DEXInitErrorMsg" = "Something unexpected happened, please restart the Cryptopower Wallet."
"DEXInitErrorMsg" = "Something unexpected happened, please revisit this page or restart the Cryptopower Wallet."
"txRegular" = "Regular Transactions"
"stakingTx" = "Staking Transactions"
"filter" = "Filter"
Expand Down Expand Up @@ -933,4 +933,8 @@ const EN = `
"dexSeed" = "DEX Seed"
"optionalRestorationSeed" = "Restoration Seed (optional)"
"dexServerDisconnected" = "DEX server is disconnected"
"dexMsgAfterReset" = "It seems DCRDEX has been reset, please revisit this page."
"updateAPI" = "Check for Update API"
"newUpdateText" = "A new update, %s, is available"
"updateAvailable" = "Update Available"
`
4 changes: 2 additions & 2 deletions ui/values/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ const (
StrSwitchToTestnet = "switchToTestnet"
StrDexMainnetNotReady = "dexMainnetNotReady"
StrUpdateDEXWalletPasswordReason = "updateDEXWalletPasswordReason"
StrLoginDEXForActiveOrdersOrExpiredBonds = "loginDEXForActiveOrdersOrExpiredBonds"
StrWalletsNeedToSync = "walletsNeedToSync"
StrWalletsNeedToSyncMsg = "walletsNeedToSyncMsg"
StrIWillSyncLater = "iWillSyncLater"
Expand All @@ -1040,9 +1041,8 @@ const (
StrBackupDEXSeed = "backupDEXSeed"
StrDEXSeed = "dexSeed"
StrOptionalRestorationSeed = "optionalRestorationSeed"
StrLoginLater = "loginLater"
StrDEXMsgAfterReset = "dexMsgAfterReset"
StrDEXServerDisconnected = "dexServerDisconnected"
StrLoginDEXForActiveOrdersOrExpiredBonds = "loginDEXForActiveOrdersOrExpiredBonds"
StrUpdateAPI = "updateAPI"
StrNewUpdateText = "newUpdateText"
StrUpdateAvailable = "updateAvailable"
Expand Down

0 comments on commit cdfa6ed

Please sign in to comment.