Skip to content

Commit

Permalink
Update the NewCommittee variant of GovernanceAction to `UpdateCom…
Browse files Browse the repository at this point in the history
…mittee` (#5718)
  • Loading branch information
zliu41 authored Jan 13, 2024
1 parent 2fea70c commit 0e6cc56
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,14 @@
Unit
in
\(d : data) -> go (unMapData d)
data Rational | Rational_match where
Rational : integer -> integer -> Rational
data Committee | Committee_match where
Committee :
(\k v -> List (Tuple2 k v)) Credential integer -> Rational -> Committee
data ProtocolVersion | ProtocolVersion_match where
ProtocolVersion : integer -> integer -> ProtocolVersion
data Rational | Rational_match where
Rational : integer -> integer -> Rational
data GovernanceAction | GovernanceAction_match where
HardForkInitiation :
Maybe GovernanceActionId -> ProtocolVersion -> GovernanceAction
InfoAction : GovernanceAction
NewCommittee :
Maybe GovernanceActionId ->
List Credential ->
Committee ->
GovernanceAction
NewConstitution :
Maybe GovernanceActionId -> Maybe bytestring -> GovernanceAction
NoConfidence : Maybe GovernanceActionId -> GovernanceAction
Expand All @@ -258,6 +250,12 @@
(\k v -> List (Tuple2 k v)) Credential integer ->
Maybe bytestring ->
GovernanceAction
UpdateCommittee :
Maybe GovernanceActionId ->
List Credential ->
(\k v -> List (Tuple2 k v)) Credential integer ->
Rational ->
GovernanceAction
data ProposalProcedure | ProposalProcedure_match where
ProposalProcedure :
integer -> Credential -> GovernanceAction -> ProposalProcedure
Expand Down Expand Up @@ -407,8 +405,9 @@
let
!l : list data
= tailList {data} args
!l : list data = tailList {data} l
in
NewCommittee
UpdateCommittee
(`$fUnsafeFromDataMaybe_$cunsafeFromBuiltinData`
{GovernanceActionId}
`$fUnsafeFromDataGovernanceAction_$cunsafeFromBuiltinData`
Expand All @@ -417,98 +416,59 @@
{Credential}
`$fUnsafeFromDataCredential_$cunsafeFromBuiltinData`
(headList {data} l))
(`$fUnsafeFromDataMap_$cunsafeFromBuiltinData`
{Credential}
{integer}
`$fUnsafeFromDataCredential_$cunsafeFromBuiltinData`
unIData
(headList {data} l))
(let
!tup : pair integer (list data)
= unConstrData
(headList
{data}
(tailList {data} l))
!index : integer
= fstPair
{integer}
{list data}
tup
!args : list data
= sndPair
{integer}
{list data}
tup
!x : data
= headList
{data}
(tailList {data} l)
in
ifThenElse
{all dead. Committee}
(equalsInteger 0 index)
(/\dead ->
Committee
(`$fUnsafeFromDataMap_$cunsafeFromBuiltinData`
{Credential}
Tuple2_match
{integer}
{integer}
(let
!tup : pair integer (list data)
= unConstrData x
!index : integer
= fstPair
{integer}
`$fUnsafeFromDataCredential_$cunsafeFromBuiltinData`
unIData
(headList {data} args))
(let
!x : data
= headList
{list data}
tup
!args : list data
= sndPair
{integer}
{list data}
tup
in
ifThenElse
{all dead.
Tuple2 integer integer}
(equalsInteger 0 index)
(/\dead ->
Tuple2
{integer}
{integer}
(unIData
(headList {data} args))
(unIData
(headList
{data}
(tailList
{data}
args)
in
Tuple2_match
{integer}
{integer}
(let
!tup :
pair
integer
(list data)
= unConstrData x
!index : integer
= fstPair
{integer}
{list data}
tup
!args : list data
= sndPair
{integer}
{list data}
tup
in
ifThenElse
{all dead.
Tuple2
integer
integer}
(equalsInteger 0 index)
(/\dead ->
Tuple2
{integer}
{integer}
(unIData
(headList
{data}
args))
(unIData
(headList
{data}
(tailList
{data}
args))))
(/\dead ->
traceError
{Tuple2
integer
integer}
reconstructCaseError)
{all dead. dead})
{Rational}
(\(a : integer)
(b : integer) ->
unsafeRatio a b)))
(/\dead ->
traceError
{Committee}
reconstructCaseError)
{all dead. dead}))
args))))
(/\dead ->
traceError
{Tuple2 integer integer}
reconstructCaseError)
{all dead. dead})
{Rational}
(\(a : integer) (b : integer) ->
unsafeRatio a b)))
(/\dead ->
ifThenElse
{all dead. GovernanceAction}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2869
2833
Loading

0 comments on commit 0e6cc56

Please sign in to comment.