Skip to content

Commit

Permalink
- sync changes with dcrlibwallet
Browse files Browse the repository at this point in the history
- get pi key from chain params
  • Loading branch information
dreacot committed Jun 23, 2022
1 parent 37e7c02 commit 401ab22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ require (
// of those projects update their github.com/lib/pq dependency.
replace github.com/lib/pq => github.com/lib/pq v1.10.4

replace github.com/planetdecred/dcrlibwallet => github.com/dreacot/dcrlibwallet v1.6.1-0.20220620223945-eae5ef7c54a1
replace github.com/planetdecred/dcrlibwallet => github.com/dreacot/dcrlibwallet v1.6.1-0.20220623143947-b5da4ebae4c5
4 changes: 2 additions & 2 deletions ui/page/components/treasury_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func layoutPiKey(gtx C, l *load.Load, treasuryKeyPolicy dcrlibwallet.TreasuryKey

var backgroundColor color.NRGBA

statusLabel := l.Theme.Label(values.TextSize14, treasuryKeyPolicy.Key)
statusLabel := l.Theme.Label(values.TextSize14, treasuryKeyPolicy.PiKey)
backgroundColor = l.Theme.Color.LightBlue

return layout.Flex{Spacing: layout.SpaceBetween}.Layout(gtx,
Expand Down Expand Up @@ -127,7 +127,7 @@ func LayoutNoPoliciesFound(gtx C, l *load.Load, syncing bool) D {
}

func LoadPolicies(l *load.Load, selectedWallet *dcrlibwallet.Wallet, pikey string) []*TreasuryItem {
policies, err := selectedWallet.AllTreasuryPolicies(pikey, "")
policies, err := selectedWallet.TreasuryPolicies(pikey, "")
if err != nil {
return nil
}
Expand Down
8 changes: 2 additions & 6 deletions ui/page/governance/treasury_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,7 @@ func (pg *TreasuryPage) FetchPolicies() {
// Fetch (or re-fetch) treasury policies in background as this makes
// a network call. Refresh the window once the call completes.
go func() {
PiKey := dcrlibwallet.MainnetPiKeys[0]
if pg.WL.MultiWallet.NetType() == dcrlibwallet.Testnet3 {
PiKey = dcrlibwallet.TestnetPiKeys[0]
}
pg.treasuryItems = components.LoadPolicies(pg.Load, selectedWallet, PiKey)
pg.treasuryItems = components.LoadPolicies(pg.Load, selectedWallet, pg.WL.MultiWallet.PiKey(0))
pg.isPolicyFetchInProgress = true
pg.ParentWindow().Reload()
}()
Expand Down Expand Up @@ -279,7 +275,7 @@ func (pg *TreasuryPage) updatePolicyPreference(treasuryItem *components.Treasury
go func() {
selectedWallet := pg.WL.SelectedWallet.Wallet
votingPreference := treasuryItem.OptionsRadioGroup.Value
err := selectedWallet.SetTreasuryPolicy(treasuryItem.Policy.Key, votingPreference, "", []byte(password))
err := selectedWallet.SetTreasuryPolicy(treasuryItem.Policy.PiKey, votingPreference, "", []byte(password))
if err != nil {
if err.Error() == dcrlibwallet.ErrInvalidPassphrase {
pm.SetError(values.String(values.StrInvalidPassphrase))
Expand Down

0 comments on commit 401ab22

Please sign in to comment.