Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion daml/dars.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ splice-dso-governance 0.1.22 5c28530209b9ab37c5f187132cd826709bb18b0efe28411488a
splice-dso-governance 0.1.23 0c94a036ac5168a1dee26b435838e062f0d2f47d6eac49303978228ae559edb9
splice-dso-governance 0.1.24 4974c654485d4ecaa6b5caf8ef3c2679efa8195c4b50d4965a8fff1b72e8efa4
splice-dso-governance 0.1.25 b41ffa8aadafc8ae78eeb39b201eca9bc96470267d36553badd5df2a0587b16f
splice-dso-governance 0.1.26 d65173dabe1b5e7278ffb66c55defb123f72df18218c7e317bcc4f703f08a84e
splice-dso-governance 0.1.3 b0ae3cc03e418790305a3c15f761fe495572de5827f8d322fb8b96996b783c13
splice-dso-governance 0.1.4 dc24fd18b4d151cd1e0ff6bfb7438bafb2f50fe076d0f16f50565e60b153a0be
splice-dso-governance 0.1.5 9e3ca1d22ad495dfabf3d61acae3dc1a7718f527f02092280b58cf69edfdc84c
splice-dso-governance 0.1.6 4e7653cfbf7ca249de4507aca9cd3b91060e5489042a522c589d3c4199580cd8
splice-dso-governance 0.1.7 d406eba1132d464605f4dae3edf8cf5ecbbb34bd8edef0e047e7e526d328718c
splice-dso-governance 0.1.8 1790a114f83d5f290261fae1e7e46fba75a861a3dd603c6b4ef6b67b49053948
splice-dso-governance 0.1.9 9ee83bfd872f91e659b8a8439c5b4eaf240bcf6f19698f884d7d7993ab48c401
splice-dso-governance-test 0.1.31 96128520faebb74a7d11fcc80026d323d73e9d3c690e1b17f5cc86cd36e5e678
splice-dso-governance-test 0.1.32 fa46050005e80ae224092a236136d8b64599dd21f51543978d0a88044434687f
splice-token-standard-test 1.0.13 a556574314ab5ecbfa04b04a6b6c9259cf90388461fe307ba712257ad5993a6b
splice-token-test-dummy-holding 0.0.1 1cd171c6c42ab46dc9cf12d80c6111369e00cea5cdf054924b4f26ce94b1ef5b
splice-token-test-dummy-holding 0.0.2 4f40fb033ef3db89623642c1b494e846097fa32af138b3864a63aa15937a323d
Expand Down
Binary file added daml/dars/splice-dso-governance-0.1.26.dar
Binary file not shown.
2 changes: 1 addition & 1 deletion daml/splice-dso-governance-test/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sdk-version: 3.4.11
name: splice-dso-governance-test
source: daml
version: 0.1.31
version: 0.1.32
dependencies:
- daml-prim
- daml-stdlib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ initiateAndCastVote app (initiator::others) targetEffectiveAt action = do
requestCid
vote = Vote with
sv
castBy = sv
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "✓"
optCastAt = None
Expand All @@ -379,6 +381,8 @@ initiateAndAcceptVote app (initiator::others) action = do
requestCid
vote = Vote with
sv
castBy = sv
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "✓"
optCastAt = None
Expand All @@ -392,6 +396,8 @@ castVote app sv requestCid vote = do
requestCid = requestCid
vote = Vote with
sv = sv
castBy = sv
castByRole = VCR_Operator
accept = vote
reason = Reason with
url = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,18 @@ testVoteUpdateKeepsOneSlotPerSv = do
Map.size initialRequest.votes === 1
case Map.lookup initialRequest.requester initialRequest.votes of
None -> fail "requester vote missing"
Some vote -> vote.sv === sv1
Some vote -> do
vote.sv === sv1
vote.castBy === sv1
vote.castByRole === VCR_Operator

passTime (minutes 1)
result <- submit (actAs sv1 <> readAs dso) $ exerciseCmd dsoRulesCid DsoRules_CastVote with
requestCid = initialRequestCid
vote = Vote with
sv = sv1
castBy = sv1
castByRole = VCR_Operator
accept = False
reason = Reason with url = ""; body = "updated vote"
optCastAt = None
Expand All @@ -141,6 +146,8 @@ testVoteUpdateKeepsOneSlotPerSv = do
None -> fail "updated requester vote missing"
Some vote -> do
vote.sv === sv1
vote.castBy === sv1
vote.castByRole === VCR_Operator
vote.accept === False

-- | Tests vote request machinery on featured app right granting and revoking without effectivity.
Expand Down Expand Up @@ -523,27 +530,35 @@ testRacingSvRemoval = do
requestCid
vote = Vote with
sv = sv1
castBy = sv1
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "OK, let them go"
optCastAt = None
result2 <- submit (actAs sv2 <> readAs dso) $ exerciseCmd dsoRulesCid DsoRules_CastVote with
requestCid = result1.voteRequest
vote = Vote with
sv = sv2
castBy = sv2
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "OK, let them go"
optCastAt = None
result3 <- submit (actAs sv3 <> readAs dso) $ exerciseCmd dsoRulesCid DsoRules_CastVote with
requestCid = result2.voteRequest
vote = Vote with
sv = sv3
castBy = sv3
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "OK, let them go"
optCastAt = None
result4 <- submit (actAs sv4 <> readAs dso) $ exerciseCmd dsoRulesCid DsoRules_CastVote with
requestCid = result3.voteRequest
vote = Vote with
sv = sv4
castBy = sv4
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "OK, let them go"
optCastAt = None
Expand Down Expand Up @@ -650,6 +665,8 @@ testRacingSvRemoval = do
requestCid = result5.voteRequest
vote = Vote with
sv = sv4
castBy = sv4
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "yes, let me go please!"
optCastAt = None
Expand Down Expand Up @@ -1181,6 +1198,8 @@ testVoteCastingCooldown = do
requestCid
vote = Vote with
sv = sv2
castBy = sv2
castByRole = VCR_Operator
accept = False
reason = Reason with url = ""; body = "noooo, let me stay on please!"
optCastAt = None
Expand All @@ -1191,6 +1210,8 @@ testVoteCastingCooldown = do
requestCid
vote = Vote with
sv = sv2
castBy = sv2
castByRole = VCR_Operator
accept = False
reason = Reason with url = ""; body = "a better rebuttal"
optCastAt = None
Expand All @@ -1200,6 +1221,8 @@ testVoteCastingCooldown = do
requestCid
vote = Vote with
sv = sv1
castBy = sv1
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "a better reason"
optCastAt = None
Expand All @@ -1212,6 +1235,8 @@ testVoteCastingCooldown = do
requestCid
vote = Vote with
sv = sv2
castBy = sv2
castByRole = VCR_Operator
accept = False
reason = Reason with url = ""; body = "a better rebuttal"
optCastAt = None
Expand All @@ -1222,6 +1247,8 @@ testVoteCastingCooldown = do
requestCid
vote = Vote with
sv = sv1
castBy = sv1
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "a better reason"
optCastAt = None
Expand Down
2 changes: 1 addition & 1 deletion daml/splice-dso-governance/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sdk-version: 3.4.11
name: splice-dso-governance
source: daml
version: 0.1.25
version: 0.1.26
dependencies:
- daml-prim
- daml-stdlib
Expand Down
19 changes: 16 additions & 3 deletions daml/splice-dso-governance/daml/Splice/DsoRules.daml
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,17 @@ data VoteRequestOutcome
dummyUnitField : ()
-- ^ Extension constructor (and field) to work around the current lack of upgrading for variants in Daml 3.0
deriving (Eq, Show)
data VoteCastRole
= VCR_Operator
| VCR_GovernanceVoter
deriving(Eq, Show)

--
-- | A vote cast by an SV.
-- | A vote cast for an SV.
data Vote = Vote with
sv : Party -- ^ The SV party used to submit the vote.
sv : Party -- ^ The represented SV whose vote slot is updated.
castBy : Party -- ^ The party that signed the vote command.
castByRole : VoteCastRole -- ^ The authority path used to cast the vote.
accept : Bool
-- ^ Whether the responder accepted the request to execute the action or not.
reason : Reason
Expand Down Expand Up @@ -764,6 +771,8 @@ template DsoRules with
require "There is some time to vote" (now < voteBefore)
let requesterVote = Vote with
sv = requester
castBy = requester
castByRole = VCR_Operator
accept = True
reason = Reason with url = ""; body = "I accept, as I requested the vote."
optCastAt = Some now
Expand Down Expand Up @@ -802,8 +811,12 @@ template DsoRules with
pastVote.optCastAt
-- store vote
now <- getTime
let recordedVote = vote with
castBy = vote.sv
castByRole = VCR_Operator
optCastAt = Some now
voteRequest <- create request with
votes = Map.insert voterName (vote with optCastAt = Some now) request.votes
votes = Map.insert voterName recordedVote request.votes
trackingCid = Some (fromOptional requestCid request.trackingCid)
return DsoRules_CastVoteResult with ..

Expand Down
4 changes: 4 additions & 0 deletions docs/src/sv_operator/sv_governance_voter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ intended to be an alternate signer for the represented SV's vote on explicitly
supported non-operational governance actions; it is not a new voting unit and
does not add voting weight.

Vote records carry the represented SV and the party/role that cast the vote.
This attribution is accountability metadata for the authority path; tallying
continues to use the represented SV's vote slot.

The first contract slice uses a hardcoded Daml allowlist for governance-voter
eligible actions. New ``ActionRequiringConfirmation`` constructors are rejected
by default until reviewed and added deliberately. The proposed allowlist is
Expand Down