Skip to content

Commit

Permalink
feat: update governance endpoints to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
gleiser-oliveira committed Oct 24, 2023
1 parent fa792bf commit 18cc0d4
Show file tree
Hide file tree
Showing 83 changed files with 2,778 additions and 2,767 deletions.
518 changes: 218 additions & 300 deletions src/__mocks__/api/proposals.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/__mocks__/api/voteSummary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"for": "6.05461e+23",
"against": "0",
"abstain": "0",
"total": "6.05461e+23"
}
139 changes: 61 additions & 78 deletions src/__mocks__/api/voterAccounts.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,63 @@
{
"data": {
"limit": 100,
"offset": 0,
"result": [
{
"address": "0xfea1c651a47fe29db9b1bf3cc1f224d8d9cff68c",
"createdAt": "2021-12-30T07:03:00.000Z",
"id": "23b9e102-fc8f-45e0-8a9a-041a10309147",
"proposalsVoted": 22,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0.589888,
"votes": "1021378937600000000000012",
"votes2": "000000000000000000000001021378937600000000000012"
},
{
"address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706",
"createdAt": "2021-12-30T07:03:00.000Z",
"id": "a246feff-c65a-4fe6-a732-5ec43172bb7b",
"proposalsVoted": 42,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0.410112,
"votes": "710101000000000000000000",
"votes2": "000000000000000000000000710101000000000000000000"
},
{
"address": "0x6eace20e1f89d0b24e5b295af1802dfbc730b37d",
"createdAt": "2022-04-25T17:47:01.000Z",
"id": "47c7162f-f95d-4129-9687-8bb7aa4f0c50",
"proposalsVoted": 4,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0,
"votes": "0",
"votes2": "000000000000000000000000000000000000000000000000"
},
{
"address": "0xfedd302cfafc03a7d4dfc99342fe20e0521c265a",
"createdAt": "2022-06-23T19:16:01.000Z",
"id": "a6e71ee5-0917-4a15-a907-7420291c619c",
"proposalsVoted": 1,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0,
"votes": "0",
"votes2": "000000000000000000000000000000000000000000000000"
},
{
"address": "0xd2e106a978d766bc9f6fda296c7ec1c23839067c",
"createdAt": "2022-06-06T17:52:01.000Z",
"id": "c5f13a38-fbfe-40a7-b141-a2a18b219436",
"proposalsVoted": 4,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0,
"votes": "0",
"votes2": "000000000000000000000000000000000000000000000000"
},
{
"address": "0xac01afa9f45dd61f234a401f4650fff5a3971117",
"createdAt": "2022-01-14T13:14:00.000Z",
"id": "d6c99cab-d467-4a57-a22d-54e39f9a6bc8",
"proposalsVoted": 1,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0,
"votes": "0",
"votes2": "000000000000000000000000000000000000000000000000"
},
{
"address": "0x92f66fcbcb5ec844ee8505b1861d084e12f54505",
"createdAt": "2021-12-30T07:03:00.000Z",
"id": "e067b683-fc68-4a79-8059-0cafb408d2f2",
"proposalsVoted": 5,
"updatedAt": "2022-06-24T13:29:01.000Z",
"voteWeight": 0,
"votes": "0",
"votes2": "000000000000000000000000000000000000000000000000"
}
],
"total": 7
},
"status": true
"limit": 100,
"page": 0,
"result": [
{
"address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706",
"voteWeight": "0.3948365670826356053",
"proposalsVoted": 405,
"votesMantissa": "6.05461e+23",
"stakedVotesMantissa": "6.05561e+23",
"delegate": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706"
},
{
"address": "0xD4a9F68DEbed2F8D7cE0115d415cc992AB0BFbcc",
"voteWeight": "0.00003260627580328342",
"proposalsVoted": 0,
"votesMantissa": "50000000000000000000",
"stakedVotesMantissa": "55000000000000000000",
"delegate": "0xD4a9F68DEbed2F8D7cE0115d415cc992AB0BFbcc"
},
{
"address": "0xFEdD302cFAFC03A7d4DFC99342fe20E0521C265A",
"voteWeight": "0.26227211824242645333",
"proposalsVoted": 16,
"votesMantissa": "4.02180426591398612445922e+23",
"stakedVotesMantissa": "1.00000054991398612445922e+23",
"delegate": "0xFEdD302cFAFC03A7d4DFC99342fe20E0521C265A"
},
{
"address": "0x6eACe20E1F89D0B24e5B295Af1802dfBc730B37D",
"voteWeight": "0.19125097865572056809",
"proposalsVoted": 31,
"votesMantissa": "3.020803716e+23",
"stakedVotesMantissa": "3.020803716e+23",
"delegate": "0x6eACe20E1F89D0B24e5B295Af1802dfBc730B37D"
},
{
"address": "0xD2e106A978D766Bc9F6FdA296C7EC1c23839067C",
"voteWeight": "0.19564012962507825585",
"proposalsVoted": 25,
"votesMantissa": "3.000037949832e+23",
"stakedVotesMantissa": "3.000037949832e+23",
"delegate": "0xD2e106A978D766Bc9F6FdA296C7EC1c23839067C"
},
{
"address": "0x2EF706339560Ffd848c04bcD1b611edE0a0b79b7",
"voteWeight": "0.00000652125516065668",
"proposalsVoted": 0,
"votesMantissa": "10000000000000000000",
"stakedVotesMantissa": "10000000000000000000",
"delegate": "0x2EF706339560Ffd848c04bcD1b611edE0a0b79b7"
},
{
"address": "0x54950126D02532F852920A04f46359E617F48f3D",
"voteWeight": "0",
"proposalsVoted": 0,
"votesMantissa": "0",
"stakedVotesMantissa": "310413900000000000000",
"delegate": null
}
],
"total": 7
}
112 changes: 51 additions & 61 deletions src/__mocks__/api/voterDetails.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,53 @@
{
"data": {
"balance": "0",
"delegateCount": 1,
"delegates": "0x315deBE419d9f9aec19807609b396Ef33a9c44C0",
"txs": [
{
"amount": "2470334759651375154",
"blockNumber": 18051658,
"blockTimestamp": 1653308122,
"createdAt": "2022-05-23T12:15:31.000Z",
"from": "0x315debe419d9f9aec19807609b396ef33a9c44c0",
"id": "bd9f3e2a-9094-4a52-9e5b-eb5b0856b3b6",
"to": "0x7eb5d86fd78f3852a3e0e064f2842d45a3db6ea2",
"transactionHash": "0x1d6c5d29ba91dbe1e6150d2335bba9a2b99bf850b1c5255ed76e076bc8f0932c",
"transactionIndex": 19,
"type": "transfer",
"updatedAt": "2022-05-23T12:15:31.000Z"
},
{
"amount": "2470307000576804910",
"blockNumber": 18051572,
"blockTimestamp": 1653307864,
"createdAt": "2022-05-23T12:11:10.000Z",
"from": "0xfd36e2c2a6789db23113685031d7f16329158384",
"id": "d552fb27-3df2-4681-addc-a4ea17e65a8a",
"to": "0x315debe419d9f9aec19807609b396ef33a9c44c0",
"transactionHash": "0xb312250c6f5d4c288d79c9855dc7fceed8c5f10b4b8b1fec66130deadafa21ab",
"transactionIndex": 201,
"type": "transfer",
"updatedAt": "2022-05-23T12:11:30.000Z"
},
{
"amount": "3019084454051545384",
"blockNumber": 17824116,
"blockTimestamp": 1652619724,
"createdAt": "2022-05-15T13:02:30.000Z",
"from": "0x315debe419d9f9aec19807609b396ef33a9c44c0",
"id": "5bf2043a-3bfc-4e23-b43a-f7689d3b8d3d",
"to": "0x7eb5d86fd78f3852a3e0e064f2842d45a3db6ea2",
"transactionHash": "0x860625c320493e7f900017e4ff6d2700c5def8b81aaef16e0adcbcd2f9100b9a",
"transactionIndex": 85,
"type": "transfer",
"updatedAt": "2022-05-15T13:02:30.000Z"
},
{
"amount": "85354896669975801",
"blockNumber": 17824104,
"blockTimestamp": 1652619685,
"createdAt": "2022-05-15T13:01:40.000Z",
"from": "0xfd36e2c2a6789db23113685031d7f16329158384",
"id": "cc926164-6e64-4be0-b8b3-18c7c23a4ab8",
"to": "0x315debe419d9f9aec19807609b396ef33a9c44c0",
"transactionHash": "0x2dffbd3f586f3ecf7b6309a9a566c1a9f5da7cec97e6e466172ccb2d59452a70",
"transactionIndex": 131,
"type": "transfer",
"updatedAt": "2022-05-15T13:01:41.000Z"
}
],
"votes": "0",
"status": true
}
"balance": "0",
"delegateCount": 1,
"delegates": "0x315deBE419d9f9aec19807609b396Ef33a9c44C0",
"txs": [
{
"id": "b3adc24f-3db6-407e-8a02-da11a6033ff9",
"category": "vote",
"event": "ProposalExecuted",
"transactionHash": "0x8ef7a72736d49f4babd624c8dc353589a1d659fe9995f358cca8c2305f21b2ba",
"logIndex": 23,
"from": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706",
"to": "",
"tokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff",
"amountMantissa": "0",
"blockNumber": 33507543,
"timestamp": 1695219527,
"createdAt": "2023-09-20T14:19:28.000Z",
"updatedAt": "2023-09-20T14:19:28.000Z"
},
{
"id": "e13dd361-c9fd-4185-b03e-81ef5059c80f",
"category": "vote",
"event": "ProposalQueued",
"transactionHash": "0x149cbd8512f6566dfb366d0c67ed46709f00f5dc0f819039b8636b1e4b33211c",
"logIndex": 11,
"from": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706",
"to": "",
"tokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff",
"amountMantissa": "0",
"blockNumber": 33506948,
"timestamp": 1695217742,
"createdAt": "2023-09-20T13:49:16.000Z",
"updatedAt": "2023-09-20T13:49:16.000Z"
},
{
"id": "24060d38-a4b2-4a5c-a814-2618e8678aa3",
"category": "vote",
"event": "VoteCast",
"transactionHash": "0xee454374e8e6fa44c025fd7b0a2c6f2511dabd45c5764fe67f4649754bf49edb",
"logIndex": 7,
"from": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706",
"to": "",
"tokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff",
"amountMantissa": "605461000000000000000000",
"blockNumber": 33506326,
"timestamp": 1695215876,
"createdAt": "2023-09-20T13:18:02.000Z",
"updatedAt": "2023-09-20T13:18:02.000Z"
}
],
"votes": "0"
}
Loading

0 comments on commit 18cc0d4

Please sign in to comment.