Negatives Votes Implemented

This commit is contained in:
Luis Fernando Molina committed 2021-10-14 17:28:57 +02:00
1 parent 4d5690bcd6
commit 1705961d68
8 files changed
+7991 -392

No files matched your search

@@ -49,7 +49,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -49,7 +49,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -33,12 +33,12 @@
"id": "2e9dff69-e407-4ccb-9a42-e4a476e28d7c",
"savedPayload": {
"position": {
"x": 17101.152987491874,
"y": 27698.09021775731
"x": 16579.81965415854,
"y": 43970.43851497094
},
"targetPosition": {
"x": 17178.79870102263,
"y": 27987.867965644033
"x": 16657.465367689296,
"y": 44260.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -63,12 +63,12 @@
"id": "af1984a3-465b-48ed-9944-c101a8ed376c",
"savedPayload": {
"position": {
"x": 17217.956558688646,
"y": 27690.43450723189
"x": 16696.62322535531,
"y": 43962.78280444552
},
"targetPosition": {
"x": 17178.79870102263,
"y": 27987.867965644033
"x": 16657.465367689296,
"y": 44260.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -87,12 +87,12 @@
"id": "9f94d0e0-ddf7-4e04-8a3c-9485c09e079d",
"savedPayload": {
"position": {
"x": 17178.79870102263,
"y": 27987.867965644033
"x": 16657.465367689296,
"y": 44260.21626285766
},
"targetPosition": {
"x": 17178.79870102263,
"y": 28287.867965644033
"x": 16657.465367689296,
"y": 44560.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -124,12 +124,12 @@
"id": "c41497c5-7440-4ebd-aabb-fbc3d022136b",
"savedPayload": {
"position": {
"x": 17540.930735378595,
"y": 27815.928310152736
"x": 17019.59740204526,
"y": 44088.276607366366
},
"targetPosition": {
"x": 17390.930735378595,
"y": 28075.73593128807
"x": 16869.59740204526,
"y": 44348.0842285017
},
"floatingObject": {
"isPinned": false,
@@ -154,12 +154,12 @@
"id": "6625953a-6026-4686-9091-2796fd08b9a7",
"savedPayload": {
"position": {
"x": 17628.936737465967,
"y": 27893.10750258545
"x": 17107.60340413263,
"y": 44165.455799799085
},
"targetPosition": {
"x": 17390.930735378595,
"y": 28075.73593128807
"x": 16869.59740204526,
"y": 44348.0842285017
},
"floatingObject": {
"isPinned": false,
@@ -178,12 +178,12 @@
"id": "174e7d3b-fe3c-4fb1-825c-4ea488d82171",
"savedPayload": {
"position": {
"x": 17390.930735378595,
"y": 28075.73593128807
"x": 16869.59740204526,
"y": 44348.0842285017
},
"targetPosition": {
"x": 17178.79870102263,
"y": 28287.867965644033
"x": 16657.465367689296,
"y": 44560.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -215,12 +215,12 @@
"id": "53ddcc36-f693-4193-8284-999a88f1c944",
"savedPayload": {
"position": {
"x": 17768.576448909353,
"y": 28210.222252113275
"x": 17247.243115576017,
"y": 44482.570549326905
},
"targetPosition": {
"x": 17478.79870102263,
"y": 28287.867965644033
"x": 16957.465367689296,
"y": 44560.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -245,12 +245,12 @@
"id": "ff1e4a84-3363-4348-ad15-31a34898fa82",
"savedPayload": {
"position": {
"x": 17776.232159434774,
"y": 28327.025823310047
"x": 17254.89882610144,
"y": 44599.37412052368
},
"targetPosition": {
"x": 17478.79870102263,
"y": 28287.867965644033
"x": 16957.465367689296,
"y": 44560.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -269,12 +269,12 @@
"id": "8b3714a0-3bf2-491e-8ffc-9c4286446382",
"savedPayload": {
"position": {
"x": 17478.79870102263,
"y": 28287.867965644033
"x": 16957.465367689296,
"y": 44560.21626285766
},
"targetPosition": {
"x": 17178.79870102263,
"y": 28287.867965644033
"x": 16657.465367689296,
"y": 44560.21626285766
},
"floatingObject": {
"isPinned": false,
@@ -337,12 +337,12 @@
"id": "0e10c82f-94b3-4f39-b673-15eaf0551df4",
"savedPayload": {
"position": {
"x": 43427.30754996297,
"y": 28199.999999999996
"x": 17264.948575603998,
"y": 44472.348297213626
},
"targetPosition": {
"x": 43167.49992882764,
"y": 28349.999999999996
"x": 17005.140954468665,
"y": 44622.348297213626
},
"floatingObject": {
"isPinned": false,
@@ -361,12 +361,12 @@
"id": "5332a29f-2139-4dd9-aa77-f87fcbf513df",
"savedPayload": {
"position": {
"x": 43167.49992882764,
"y": 28349.999999999996
"x": 17005.140954468665,
"y": 44622.348297213626
},
"targetPosition": {
"x": 42907.692307692305,
"y": 28499.999999999996
"x": 16745.333333333332,
"y": 44772.348297213626
},
"floatingObject": {
"isPinned": false,
@@ -398,12 +398,12 @@
"id": "8829c80f-028b-4315-85a1-82ad502f0687",
"savedPayload": {
"position": {
"x": 43427.30754996297,
"y": 28799.999999999996
"x": 17264.948575603998,
"y": 45072.348297213626
},
"targetPosition": {
"x": 43167.49992882764,
"y": 28649.999999999996
"x": 17005.140954468665,
"y": 44922.348297213626
},
"floatingObject": {
"isPinned": false,
@@ -422,12 +422,12 @@
"id": "e4daed5d-1c83-4f64-a504-3aef7d73e688",
"savedPayload": {
"position": {
"x": 43167.49992882764,
"y": 28649.999999999996
"x": 17005.140954468665,
"y": 44922.348297213626
},
"targetPosition": {
"x": 42907.692307692305,
"y": 28499.999999999996
"x": 16745.333333333332,
"y": 44772.348297213626
},
"floatingObject": {
"isPinned": false,
@@ -701,7 +701,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"isCollapsed": false,
"angleToParent": 2,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -911,7 +911,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -886,7 +886,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 2,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -1769,12 +1769,12 @@
"id": "689b181e-42f2-412c-9c09-3ae51ecfa28f",
"savedPayload": {
"position": {
"x": 21934.37748907094,
"y": 45610.70880632276
"x": 21622.983453296452,
"y": 45841.30881332749
},
"targetPosition": {
"x": 21646.73156861048,
"y": 45695.913409733934
"x": 21331.27247717715,
"y": 45771.27520417071
},
"floatingObject": {
"isPinned": false,
@@ -1799,12 +1799,12 @@
"id": "91fb9b5c-f7db-4e39-89dd-f1f0cc95ff7f",
"savedPayload": {
"position": {
"x": 21945.088137220962,
"y": 45727.27194871423
"x": 21573.977575489633,
"y": 45947.610779858456
},
"targetPosition": {
"x": 21646.73156861048,
"y": 45695.913409733934
"x": 21331.27247717715,
"y": 45771.27520417071
},
"floatingObject": {
"isPinned": false,
@@ -1829,12 +1829,12 @@
"id": "3842be82-17aa-4e88-90d7-cc245d9808e2",
"savedPayload": {
"position": {
"x": 21910.37670240907,
"y": 45839.061037811814
"x": 21488.022046591934,
"y": 46027.06725347694
},
"targetPosition": {
"x": 21646.73156861048,
"y": 45695.913409733934
"x": 21331.27247717715,
"y": 45771.27520417071
},
"floatingObject": {
"isPinned": false,
@@ -1854,12 +1854,12 @@
"id": "151e981a-7a2f-465b-8ff3-851ee06d447c",
"savedPayload": {
"position": {
"x": 21646.73156861048,
"y": 45695.913409733934
"x": 21331.27247717715,
"y": 45771.27520417071
},
"targetPosition": {
"x": 21348.375,
"y": 45664.554870753636
"x": 21088.567378864667,
"y": 45594.93962848297
},
"floatingObject": {
"isPinned": false,
@@ -1890,12 +1890,12 @@
"id": "73bea818-1907-4612-903c-2d218a8273f5",
"savedPayload": {
"position": {
"x": 21854.110894970872,
"y": 45965.43611043142
"x": 21376.106891676205,
"y": 46108.37837305153
},
"targetPosition": {
"x": 21571.318447643218,
"y": 45865.294052661295
"x": 21181.27247717715,
"y": 45880.25658337152
},
"floatingObject": {
"isPinned": false,
@@ -1920,12 +1920,12 @@
"id": "032c5aeb-0ed1-4743-a75c-0a5c29e8b151",
"savedPayload": {
"position": {
"x": 21794.261895286436,
"y": 46066.03323456895
"x": 21273.977575489633,
"y": 46165.57353826007
},
"targetPosition": {
"x": 21571.318447643218,
"y": 45865.294052661295
"x": 21181.27247717715,
"y": 45880.25658337152
},
"floatingObject": {
"isPinned": false,
@@ -1950,12 +1950,12 @@
"id": "ffc9d3da-704e-4a7d-ba80-4efc68089cdc",
"savedPayload": {
"position": {
"x": 21700.471776685707,
"y": 46136.069637966255
"x": 21157.734748458795,
"y": 46179.331783491456
},
"targetPosition": {
"x": 21571.318447643218,
"y": 45865.294052661295
"x": 21181.27247717715,
"y": 45880.25658337152
},
"floatingObject": {
"isPinned": false,
@@ -1975,12 +1975,12 @@
"id": "2d71aa9f-b5e7-4078-9622-735a2e56bcbd",
"savedPayload": {
"position": {
"x": 21571.318447643218,
"y": 45865.294052661295
"x": 21181.27247717715,
"y": 45880.25658337152
},
"targetPosition": {
"x": 21348.375,
"y": 45664.554870753636
"x": 21088.567378864667,
"y": 45594.93962848297
},
"floatingObject": {
"isPinned": false,
@@ -2011,12 +2011,12 @@
"id": "cdf330b0-a11f-4045-94fc-5e44df0a786b",
"savedPayload": {
"position": {
"x": 21580.67037832278,
"y": 46205.23700756038
"x": 21019.40000927054,
"y": 46179.331783491456
},
"targetPosition": {
"x": 21410.748507245327,
"y": 45957.99915097378
"x": 20995.862280552185,
"y": 45880.25658337152
},
"floatingObject": {
"isPinned": false,
@@ -2041,12 +2041,12 @@
"id": "af91654f-e6e1-475d-bd43-1bd870b50f84",
"savedPayload": {
"position": {
"x": 21473.122014490655,
"y": 46251.443431193926
"x": 20903.1571822397,
"y": 46165.57353826007
},
"targetPosition": {
"x": 21410.748507245327,
"y": 45957.99915097378
"x": 20995.862280552185,
"y": 45880.25658337152
},
"floatingObject": {
"isPinned": false,
@@ -2071,12 +2071,12 @@
"id": "62d797d8-c1b3-4996-b5e8-322f9823826e",
"savedPayload": {
"position": {
"x": 21356.077849597685,
"y": 46252.975623242965
"x": 20801.02786605313,
"y": 46108.37837305153
},
"targetPosition": {
"x": 21410.748507245327,
"y": 45957.99915097378
"x": 20995.862280552185,
"y": 45880.25658337152
},
"floatingObject": {
"isPinned": false,
@@ -2096,12 +2096,12 @@
"id": "44213dd4-f80b-4df9-b19f-00d6aac500c6",
"savedPayload": {
"position": {
"x": 21410.748507245327,
"y": 45957.99915097378
"x": 20995.862280552185,
"y": 45880.25658337152
},
"targetPosition": {
"x": 21348.375,
"y": 45664.554870753636
"x": 21088.567378864667,
"y": 45594.93962848297
},
"floatingObject": {
"isPinned": false,
@@ -2132,12 +2132,12 @@
"id": "54843fbe-b911-4803-9983-6136975bba47",
"savedPayload": {
"position": {
"x": 21218.5009225849,
"y": 46238.51570553909
"x": 20689.1127111374,
"y": 46027.06725347694
},
"targetPosition": {
"x": 21226.35400707726,
"y": 45938.61850804642
"x": 20845.862280552185,
"y": 45771.27520417071
},
"floatingObject": {
"isPinned": false,
@@ -2162,12 +2162,12 @@
"id": "68462793-d601-45be-97e9-fa8685403179",
"savedPayload": {
"position": {
"x": 21104.333014154523,
"y": 46212.682145339204
"x": 20603.1571822397,
"y": 45947.610779858456
},
"targetPosition": {
"x": 21226.35400707726,
"y": 45938.61850804642
"x": 20845.862280552185,
"y": 45771.27520417071
},
"floatingObject": {
"isPinned": false,
@@ -2192,12 +2192,12 @@
"id": "86e8277f-be7a-4e2b-87d5-0945d3e7c541",
"savedPayload": {
"position": {
"x": 21008.741695773577,
"y": 46145.12488075455
"x": 20554.151304432882,
"y": 45841.30881332749
},
"targetPosition": {
"x": 21226.35400707726,
"y": 45938.61850804642
"x": 20845.862280552185,
"y": 45771.27520417071
},
"floatingObject": {
"isPinned": false,
@@ -2217,12 +2217,12 @@
"id": "36f4fbdf-0c47-4770-b1fc-c01d278a8cd9",
"savedPayload": {
"position": {
"x": 21226.35400707726,
"y": 45938.61850804642
"x": 20845.862280552185,
"y": 45771.27520417071
},
"targetPosition": {
"x": 21348.375,
"y": 45664.554870753636
"x": 21088.567378864667,
"y": 45594.93962848297
},
"floatingObject": {
"isPinned": false,
@@ -641,7 +641,36 @@
"config": "{}",
"project": "Governance",
"claimVotesSwitch": [],
"positionClaimVotes": [],
"positionClaimVotes": [
{
"type": "Position Claim Vote",
"name": "",
"config": "{}",
"project": "Governance",
"id": "6cebf5ee-6e03-4591-9854-2675e03d9d22",
"savedPayload": {
"position": {
"x": 29581.236192563905,
"y": 18840.192378864667
},
"targetPosition": {
"x": 29581.236192563905,
"y": 19140.192378864667
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 2,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
}
],
"assetClaimVotes": [],
"featureClaimVotes": [],
"id": "41a68bcf-16de-4b38-8c9a-3ca23f963de2",
@@ -792,7 +821,79 @@
"config": "{}",
"project": "Governance",
"positionClaimsFolders": [],
"positionContributionClaims": [],
"positionContributionClaims": [
{
"type": "Position Contribution Claim",
"name": "Project Creator Luis-Fernando-Molina Governance Project",
"config": "{}",
"project": "Governance",
"id": "5b8a612a-223b-4f48-8373-14282e81534f",
"savedPayload": {
"position": {
"x": 30031.236192563905,
"y": 20000
},
"targetPosition": {
"x": 29731.236192563905,
"y": 20000
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 2,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"referenceParent": {
"type": "Position",
"name": "Project Creator Luis-Fernando-Molina",
"id": "b555c1fb-e0d3-445f-b46d-9428818b5fe5"
},
"referenceParentCombinedNodePath": [
[
"Superalgos",
"Positions",
"Governance",
"50c68665-5da2-48a4-b229-7a1563ae82d2"
],
[
"Roles Played @ Beta-12",
"Position Class",
"Governance",
"8b29fcb2-3b9a-444f-b3b0-05976da9a18f"
],
[
"Projects",
"Position Class",
"Governance",
"864ef810-2d34-4776-946d-2f4bd68b45c5"
],
[
"Active Projects",
"Position Class",
"Governance",
"75998134-fe6b-4dd0-9995-6beb613cd165"
],
[
"Governance Project",
"Position Class",
"Governance",
"68dd2990-457e-48df-b752-6e1fd02081a3"
],
[
"Project Creator Luis-Fernando-Molina",
"Position",
"Governance",
"b555c1fb-e0d3-445f-b46d-9428818b5fe5"
]
]
}
}
],
"id": "04bfb43c-913b-4096-ab89-71fdadc72d79",
"savedPayload": {
"position": {
@@ -1068,7 +1169,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
File diff suppressed because it is too large. Load diff
@@ -282,10 +282,19 @@ function newGovernanceFunctionLibraryVotingProgram() {
return
}
/*
Setup the sign of the votes.
*/
let sign = 1
let negative = UI.projects.visualScripting.utilities.nodeConfig.loadConfigProperty(node.payload, 'negative')
if (negative === true) {
sign = - 1
}
distributeProgramPower(
currentProgramNode,
node.payload.referenceParent,
votes,
votes * sign,
undefined,
generation,
userProfile
@@ -64,7 +64,9 @@ function newGovernanceFunctionLibraryWeights() {
node.payload.votingProgram !== undefined &&
node.payload.votingProgram.votes !== undefined
) {
totalVotes = totalVotes + node.payload.votingProgram.votes
let votes = node.payload.votingProgram.votes
if (votes < 0) { votes = 0 }
totalVotes = totalVotes + votes
}
}
@@ -119,7 +121,9 @@ function newGovernanceFunctionLibraryWeights() {
) {
if (node.payload.votingProgram !== undefined) {
if (node.payload.votingProgram.votes !== undefined) {
node.payload.weight = node.payload.votingProgram.votes / totalVotes
let votes = node.payload.votingProgram.votes
if (votes < 0) { votes = 0 }
node.payload.weight = votes / totalVotes
}
}
}