Skip to content

Commit 376dcb0

Browse files
committed
Fix bug with governance proposal fetching and parsing, increment to v1.0.3
1 parent b567dd0 commit 376dcb0

5 files changed

Lines changed: 12 additions & 9 deletions

File tree

electron/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function setCspHeader() {
5454
...details.responseHeaders,
5555
// Should match header in /netlify/_headers and build.sh
5656
'Content-Security-Policy': [
57-
"default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org https://*.celo-testnet.org; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'",
57+
"default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org https://*.celo-testnet.org https://api.github.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'",
5858
],
5959
},
6060
})

package-electron.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"main": "main.js",
66
"keywords": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"keywords": [
66
"Celo",

src/features/governance/fetchProposals.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,29 @@ export async function fetchCurrentProposals(): Promise<Proposal[]> {
4040

4141
// Get unexpired queued and dequeued proposals
4242
const queuedP: Promise<QueueRaw> = governance.getQueue()
43-
const dequeuedP: Promise<string[]> = governance.getDequeue()
43+
const dequeuedP: Promise<BigNumberish[]> = governance.getDequeue()
4444
const [queued, dequeued] = await Promise.all([queuedP, dequeuedP])
4545

46-
let queuedIds = queued[0].map((p) => p.toString()).filter((id) => !!id)
46+
let queuedIds = queued[0].map((id) => BigNumber.from(id).toString()).filter((id) => !!id)
4747
if (queuedIds.length) {
4848
const areExpired: boolean[] = await batchCall(governance, 'isQueuedProposalExpired', queuedIds)
4949
queuedIds = queuedIds.filter((id, index) => !areExpired[index])
5050
}
5151

52-
let dequeuedIds = dequeued.filter((id) => !BigNumber.from(id).isZero())
52+
const dequeuedIds = dequeued.filter((id) => !BigNumber.from(id).isZero())
53+
let unexpiredDequeuedIds: string[] = []
5354
if (dequeuedIds.length) {
5455
const areExpired: boolean[] = await batchCall(
5556
governance,
5657
'isDequeuedProposalExpired',
5758
dequeuedIds
5859
)
59-
dequeuedIds = dequeuedIds.filter((id, index) => !areExpired[index])
60+
unexpiredDequeuedIds = dequeuedIds
61+
.filter((id, index) => !areExpired[index])
62+
.map((id) => BigNumber.from(id).toString())
6063
}
6164

62-
const allIds = [...queuedIds, ...dequeuedIds]
65+
const allIds = [...queuedIds, ...unexpiredDequeuedIds]
6366
const numProps = allIds.length
6467
if (!numProps) return []
6568

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org https://*.celo-testnet.org; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'">
6+
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org https://*.celo-testnet.org https://api.github.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'">
77
<title>Celo Wallet | Use Celo on the web or on your desktop</title>
88

99
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png" />

0 commit comments

Comments
 (0)