diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c7c58ce..83009dc33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Other guiding principles: - **amaru-ledger**: validate the governance actions a transaction votes on actually exist, counting proposals submitted earlier in the same block. ([#1139][], [#924][]) - **amaru-ledger**: reject votes cast on governance actions that have expired. A proposal's expiry is now stamped once, when it is submitted, and carried through the volatile state, which will resolve some potential bugs. ([#1143][], [#926][]) - **amaru-ledger**: from protocol version 11 on, reject votes cast by constitutional committee members the *elected* committee does not name, even when they hold an authorized hot credential. ([#1157][], [#922][]) +- **amaru-ledger**: reject votes cast on a kind of governance action the voter has no say over. ([#927][]) ## [v10.11.20260806](https://github.com/pragma-org/amaru/releases/tag/v10.11.20260807) @@ -277,6 +278,7 @@ Other guiding principles: [#923]: https://github.com/pragma-org/amaru/issues/923 [#924]: https://github.com/pragma-org/amaru/issues/924 [#926]: https://github.com/pragma-org/amaru/issues/926 +[#927]: https://github.com/pragma-org/amaru/issues/927 [#928]: https://github.com/pragma-org/amaru/issues/928 [#929]: https://github.com/pragma-org/amaru/issues/929 [#942]: https://github.com/pragma-org/amaru/pull/942 diff --git a/crates/amaru-kernel/src/cardano/protocol_parameters_update.rs b/crates/amaru-kernel/src/cardano/protocol_parameters_update.rs index c96d180b6..413c788ba 100644 --- a/crates/amaru-kernel/src/cardano/protocol_parameters_update.rs +++ b/crates/amaru-kernel/src/cardano/protocol_parameters_update.rs @@ -18,7 +18,7 @@ use crate::{ CostModels, DRepVotingThresholds, ExUnitPrices, ExUnits, Lovelace, PoolVotingThresholds, RationalNumber, cbor, }; -#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, cbor::Encode, cbor::Decode)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize, cbor::Encode, cbor::Decode)] #[cbor(map)] pub struct ProtocolParamUpdate { #[n(0)] @@ -83,6 +83,22 @@ pub struct ProtocolParamUpdate { pub minfee_refscript_cost_per_byte: Option, } +impl ProtocolParamUpdate { + /// Whether the update touches any parameter of the 'security group'. + pub fn modifies_security_group(&self) -> bool { + self.minfee_a.is_some() + || self.minfee_b.is_some() + || self.max_block_body_size.is_some() + || self.max_block_header_size.is_some() + || self.max_transaction_size.is_some() + || self.ada_per_utxo_byte.is_some() + || self.max_block_ex_units.is_some() + || self.max_value_size.is_some() + || self.governance_action_deposit.is_some() + || self.minfee_refscript_cost_per_byte.is_some() + } +} + pub fn display_protocol_parameters_update(update: &ProtocolParamUpdate, prefix: &str) -> Result { let mut s = String::new(); @@ -229,3 +245,42 @@ pub fn display_protocol_parameters_update(update: &ProtocolParamUpdate, prefix: Ok(s) } + +#[cfg(test)] +mod tests { + use test_case::test_case; + + use super::*; + + fn one() -> RationalNumber { + RationalNumber { numerator: 1, denominator: 1 } + } + + #[test_case(|update| update.minfee_a = Some(1); "minfee_a")] + #[test_case(|update| update.minfee_b = Some(1); "minfee_b")] + #[test_case(|update| update.max_block_body_size = Some(1); "max_block_body_size")] + #[test_case(|update| update.max_block_header_size = Some(1); "max_block_header_size")] + #[test_case(|update| update.max_transaction_size = Some(1); "max_transaction_size")] + #[test_case(|update| update.ada_per_utxo_byte = Some(1); "ada_per_utxo_byte")] + #[test_case(|update| update.max_block_ex_units = Some(ExUnits { mem: 1, steps: 1 }); "max_block_ex_units")] + #[test_case(|update| update.max_value_size = Some(1); "max_value_size")] + #[test_case(|update| update.governance_action_deposit = Some(1); "governance_action_deposit")] + #[test_case(|update| update.minfee_refscript_cost_per_byte = Some(one()); "minfee_refscript_cost_per_byte")] + fn in_security_group(modify: fn(&mut ProtocolParamUpdate)) { + let mut update = ProtocolParamUpdate::default(); + modify(&mut update); + assert!(update.modifies_security_group()); + } + + #[test_case(|_| (); "nothing modified at all")] + #[test_case(|update| update.key_deposit = Some(1); "key_deposit")] + #[test_case(|update| update.max_tx_ex_units = Some(ExUnits { mem: 1, steps: 1 }); "max_tx_ex_units")] + #[test_case(|update| update.execution_costs = Some(ExUnitPrices { mem_price: one(), step_price: one() }); "execution_costs")] + #[test_case(|update| update.cost_models_for_script_languages = Some(CostModels { plutus_v1: None, plutus_v2: None, plutus_v3: None }); "cost_models")] + #[test_case(|update| update.drep_deposit = Some(1); "drep_deposit")] + fn out_of_security_group(modify: fn(&mut ProtocolParamUpdate)) { + let mut update = ProtocolParamUpdate::default(); + modify(&mut update); + assert!(!update.modifies_security_group()); + } +} diff --git a/crates/amaru-ledger/src/governance/ratification/stake_pools.rs b/crates/amaru-ledger/src/governance/ratification/stake_pools.rs index 02f3437a0..80f896798 100644 --- a/crates/amaru-ledger/src/governance/ratification/stake_pools.rs +++ b/crates/amaru-ledger/src/governance/ratification/stake_pools.rs @@ -14,7 +14,7 @@ use std::collections::BTreeMap; -use amaru_kernel::{DRep, PoolId, PoolVotingThresholds, ProtocolParamUpdate, Vote}; +use amaru_kernel::{DRep, PoolId, PoolVotingThresholds, Vote}; use num::Zero; use super::{CommitteeUpdate, OrphanProposal, ProposalEnum}; @@ -37,7 +37,7 @@ pub fn voting_threshold( ) -> Option { match proposal { ProposalEnum::ProtocolParameters(params_update, _) => { - if any_update_in_security_group(params_update) { + if params_update.modifies_security_group() { Some(into_safe_ratio(&voting_thresholds.security_voting_threshold)) } else { Some(SafeRatio::zero()) @@ -66,22 +66,6 @@ pub fn voting_threshold( } } -// Check whether the update contains any parameter that is considered part of the 'security group'. -// Those parameters require approval from the SPO to be changed. Others are only in the hands of -// DReps & Constitutional Committee. -fn any_update_in_security_group(update: &ProtocolParamUpdate) -> bool { - update.minfee_a.is_some() - || update.minfee_b.is_some() - || update.max_block_body_size.is_some() - || update.max_block_header_size.is_some() - || update.max_transaction_size.is_some() - || update.ada_per_utxo_byte.is_some() - || update.max_block_ex_units.is_some() - || update.max_value_size.is_some() - || update.governance_action_deposit.is_some() - || update.minfee_refscript_cost_per_byte.is_some() -} - // Tally // ---------------------------------------------------------------------------- diff --git a/crates/amaru-ledger/src/rules/transaction/phase_one/fixture.rs b/crates/amaru-ledger/src/rules/transaction/phase_one/fixture.rs index 22527da55..d32e16632 100644 --- a/crates/amaru-ledger/src/rules/transaction/phase_one/fixture.rs +++ b/crates/amaru-ledger/src/rules/transaction/phase_one/fixture.rs @@ -205,11 +205,10 @@ struct ProposalProxy { #[serde(deserialize_with = "deserialize_cbor_hex")] id: ProposalId, valid_until: Epoch, + #[serde(deserialize_with = "deserialize_cbor_hex")] + gov_action: GovernanceAction, } -/// The identity and expiry of a seeded proposal are the only parts a fixture states; the rest of -/// [`ProposalState`] is stood up as an `Information` action, the one governance action that -/// constrains nothing about who may vote on it. fn deserialize_proposals<'de, D>(deserializer: D) -> Result, D::Error> where D: serde::Deserializer<'de>, @@ -227,7 +226,7 @@ where proposal: Proposal { deposit: 0, reward_account: RewardAccount::from(vec![]), - gov_action: GovernanceAction::Information, + gov_action: entry.gov_action, anchor: Anchor { content_hash: Hash::new([0; 32]), url: String::new() }, }, }; @@ -266,6 +265,7 @@ pub(super) enum Predicate { ConflictingMetadataHash, ConwayTxRefScriptsSizeTooBig, ConwayWdrlNotDelegatedToDRep, + DisallowedVoters, FeeTooSmallUTxO, GovActionsDoNotExist, IncorrectDepositDELEG, @@ -378,6 +378,9 @@ impl From for Predicate { PhaseOneError::VotingProcedures(InvalidVotingProcedures::VotingOnExpiredGovAction(_, _)) => { Predicate::VotingOnExpiredGovAction } + PhaseOneError::VotingProcedures(InvalidVotingProcedures::DisallowedVoter(_, _)) => { + Predicate::DisallowedVoters + } PhaseOneError::ValueNotPreserved(_) => Predicate::ValueNotConservedUTxO, PhaseOneError::Certificates(InvalidCertificates::StakeCredentialInvalidPoolDelegation(ref e)) => match e { DelegateError::UnknownSource(_) => Predicate::StakeCredentialInvalidPoolDelegation, diff --git a/crates/amaru-ledger/src/rules/transaction/phase_one/voting_procedures.rs b/crates/amaru-ledger/src/rules/transaction/phase_one/voting_procedures.rs index 302793f90..857780a9b 100644 --- a/crates/amaru-ledger/src/rules/transaction/phase_one/voting_procedures.rs +++ b/crates/amaru-ledger/src/rules/transaction/phase_one/voting_procedures.rs @@ -15,8 +15,8 @@ use std::collections::{BTreeMap, BTreeSet}; use amaru_kernel::{ - EraHistory, HasOwnership, MemoizedDatum, NonEmptyKeyValuePairs, ProposalId, ProtocolVersion, RedeemerTag, - RequiredScript, StakeCredential, TransactionPointer, Voter, VotingProcedure, + EraHistory, GovernanceAction, HasOwnership, MemoizedDatum, NonEmptyKeyValuePairs, ProposalId, ProtocolVersion, + RedeemerTag, RequiredScript, StakeCredential, TransactionPointer, Voter, VotingProcedure, }; use thiserror::Error; @@ -36,6 +36,9 @@ pub enum InvalidVotingProcedures { #[error("votes cast on governance actions that have expired: Voter {0:?} on proposal {1:?}")] VotingOnExpiredGovAction(Voter, ProposalId), + #[error("vote cast on a governance action the voter has no say over: Voter {0:?} on proposal {1:?}")] + DisallowedVoter(Voter, ProposalId), + #[error("era history error: {0}")] EraHistory(#[from] amaru_kernel::EraHistoryError), } @@ -79,6 +82,10 @@ where return Err(InvalidVotingProcedures::VotingOnExpiredGovAction(voter.clone(), *proposal_id)); } + Some(state) if !is_entitled_to_vote(voter, &state.proposal.gov_action) => { + return Err(InvalidVotingProcedures::DisallowedVoter(voter.clone(), *proposal_id)); + } + Some(..) => {} } } @@ -114,7 +121,7 @@ where Ok(()) } -/// Election statushere is membership, not an unexpired term: a member whose term has run out is still +/// Election status here is membership, not an unexpired term: a member whose term has run out is still /// named by the committee, and their vote is discounted when the action is ratified instead. /// /// Voters that are not committee members are never rejected by this check. @@ -132,6 +139,28 @@ where } } +/// Whether a voter has any say over this kind of governance action +fn is_entitled_to_vote(voter: &Voter, action: &GovernanceAction) -> bool { + match voter { + Voter::ConstitutionalCommitteeKey(..) | Voter::ConstitutionalCommitteeScript(..) => { + !matches!(action, GovernanceAction::NoConfidence(..) | GovernanceAction::UpdateCommittee(..)) + } + + Voter::StakePoolKey(..) => match action { + GovernanceAction::ParameterChange(_, update, _) => update.modifies_security_group(), + + GovernanceAction::NewConstitution(..) | GovernanceAction::TreasuryWithdrawals(..) => false, + + GovernanceAction::NoConfidence(..) + | GovernanceAction::UpdateCommittee(..) + | GovernanceAction::HardForkInitiation(..) + | GovernanceAction::Information => true, + }, + + Voter::DRepKey(..) | Voter::DRepScript(..) => true, + } +} + /// Whether the entity a vote is cast by is known at this point in the block. fn exists(context: &C, voter: &Voter) -> bool where diff --git a/crates/amaru-ledger/tests/data/phase-one/README.md b/crates/amaru-ledger/tests/data/phase-one/README.md index 54f5c1542..57e7983dc 100644 --- a/crates/amaru-ledger/tests/data/phase-one/README.md +++ b/crates/amaru-ledger/tests/data/phase-one/README.md @@ -64,12 +64,10 @@ it is made up of seven fields: one or has resigned; `validUntil` is absent for a member holding no term, which is still a state a member can authorize a hot credential from. Note that a vote identifies its committee member by *hot* credential. -- `proposals`: `[{ id, validUntil }]`, the governance actions that are already on the - chain and can therefore be voted on or referenced as an ancestor. `id` is hex-encoded - CBOR of a `GovActionId` and `validUntil` is the last epoch in which a vote on the - action still counts. The action itself is not stated: the harness stands it up as an - `Information` action, which constrains nothing about who may vote on it. A rule that - needs the action's type or its proposing pointer has to extend this schema. +- `proposals`: `[{ id, validUntil, govAction }]`, the governance actions that are already + on the chain and can therefore be voted on or referenced as an ancestor. `id` is + hex-encoded CBOR of a `GovActionId`, `validUntil` is the last epoch in which a vote on + the action still counts, and `govAction` is hex-encoded CBOR of the `GovAction` itself. `protocolParameters` is loosely inspired by [Ogmios](https://github.com/CardanoSolutions/ogmios) but intentionally diverges: diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/0.json b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/0.json new file mode 100644 index 000000000..7978f5034 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/0.json @@ -0,0 +1,51 @@ +{ + "title": "vote cast by a committee member on a motion of no confidence", + "description": "The constitutional committee has no say over the action that dissolves it.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "825820b2d63157407a6741a64c9dbb84b29a02a931f2e8d469a7b9bd5f2bf78e06658d00", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [], + "accounts": [], + "dreps": [], + "committee": [ + { + "coldCredential": "8200581cecc3093b061a9ed426cd9956161fc48d4ed1ac58dc4aaed7e1ce1830", + "hotCredential": "8200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8", + "validUntil": 200 + } + ], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8203f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d9010281825820b2d63157407a6741a64c9dbb84b29a02a931f2e8d469a7b9bd5f2bf78e06658d000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db1258401b27d78d82ad1dfb14670f9230ee04ff38278579ab6452c70e24e5ea68048ccfa7adbe2e9fa24b453d9a0cad509110bdad1247c5f021bb81187f99cf42c2f70cf5f6", + "expected": { + "predicate": "DisallowedVoters" + } +} diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/1.json b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/1.json new file mode 100644 index 000000000..7c15f5de6 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/1.json @@ -0,0 +1,51 @@ +{ + "title": "vote cast by a committee member on a committee update", + "description": "The constitutional committee has no say over the action that reshapes its own membership.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "82582052b8dca44ab180eda06355c059f22641b6410935f97852fa70cdd0d3d689f32b00", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [], + "accounts": [], + "dreps": [], + "committee": [ + { + "coldCredential": "8200581cecc3093b061a9ed426cd9956161fc48d4ed1ac58dc4aaed7e1ce1830", + "hotCredential": "8200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8", + "validUntil": 200 + } + ], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8504f6d9010280a0d81e820102" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d901028182582052b8dca44ab180eda06355c059f22641b6410935f97852fa70cdd0d3d689f32b000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db1258401e909f5383d167876434d3f264da2fc51eaa22727866c6084eea3945c3aed31d8f871833ff3f2d203b1d31cfbc73cd2411f599dd81c8993225d6a84ecb1e0a08f5f6", + "expected": { + "predicate": "DisallowedVoters" + } +} diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/2.json b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/2.json new file mode 100644 index 000000000..f2f021fcf --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/2.json @@ -0,0 +1,47 @@ +{ + "title": "vote cast by a stake pool on a new constitution", + "description": "Stake pools have no say over the constitution.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "82582069cc89b96119c6a7a191c65c8b4cf7d17531e3114b4181fd7e20c2f1c9ce254500", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8305f68282781f68747470733a2f2f616d6172752e746573742f666978747572652e6a736f6e58200000000000000000000000000000000000000000000000000000000000000000f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d901028182582069cc89b96119c6a7a191c65c8b4cf7d17531e3114b4181fd7e20c2f1c9ce2545000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db12584041920b436922de329cae67b416b149c2254dd11d0be22a67fec91bbea916de58d2e129fe9043e13c3fa6002e17eaecd3286cfde5c955ab60a084bd3668b72e03f5f6", + "expected": { + "predicate": "DisallowedVoters" + } +} diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/3.json b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/3.json new file mode 100644 index 000000000..395bd5f40 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/3.json @@ -0,0 +1,47 @@ +{ + "title": "vote cast by a stake pool on a treasury withdrawal", + "description": "Stake pools have no say over the treasury.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "8258203f22e2c1a5f357e51f16fd0ada42da2168a2e202a0d0ddff4d93827404422ca000", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8302a1581de093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd81a000f4240f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d90102818258203f22e2c1a5f357e51f16fd0ada42da2168a2e202a0d0ddff4d93827404422ca0000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db125840a2c1e78d1d9c8fca939b1d07434defeb851136c5f26bbf93596cf4e6cc97ce28e24306087e0a6bbd136b2e637f45ebb565504951c254f4ce36f74a2c6127550bf5f6", + "expected": { + "predicate": "DisallowedVoters" + } +} diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/4.json b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/4.json new file mode 100644 index 000000000..12f62c7fb --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/fail/DisallowedVoters/4.json @@ -0,0 +1,47 @@ +{ + "title": "vote cast by a stake pool on a parameter change outside the security group", + "description": "A change to the DRep deposit alone, which leaves every security group parameter untouched.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "825820cd1f97def587d794ae25535c9d1389e03898f9d3ed67b9aca10c0936c4a76cd200", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8400f6a1181f1a1dcd6500f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d9010281825820cd1f97def587d794ae25535c9d1389e03898f9d3ed67b9aca10c0936c4a76cd2000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db125840920a28b696acae98447846087cd267e3518e36463dcb86e6a61c5018270461e8411fd281671f7a3ef835788429c77607c3a0580bbb72476c6bba59216e58460cf5f6", + "expected": { + "predicate": "DisallowedVoters" + } +} diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/0.json b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/0.json index ce7d914c2..b23880c24 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/0.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/0.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/1.json b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/1.json index 92f59eb5e..18b7e294c 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/1.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/1.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/2.json b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/2.json index 0233ff879..942ddf691 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/2.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/2.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/3.json b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/3.json index f11480094..e7b380deb 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/3.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/GovActionsDoNotExist/3.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/0.json b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/0.json index daab77f27..c8b0e5069 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/0.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/0.json @@ -34,7 +34,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/1.json b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/1.json index d3c02d9ec..e22c40c42 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/1.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/1.json @@ -34,7 +34,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/2.json b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/2.json index 6a26e627f..3c1d8dca1 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/2.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/2.json @@ -39,7 +39,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/3.json b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/3.json index 7af23da12..68771adbf 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/3.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/UnelectedCommitteeVoters/3.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/0.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/0.json index 142af5fa0..48b0a58ca 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/0.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/0.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/1.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/1.json index a8cca531c..971fa75aa 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/1.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/1.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/2.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/2.json index a78baa3b5..bf980e5f9 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/2.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/2.json @@ -27,7 +27,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/3.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/3.json index 4745d0e13..6c71c73e3 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/3.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/3.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/4.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/4.json index 57c8567b0..603501434 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/4.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/4.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/5.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/5.json index c63ad9595..c777ed3ba 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/5.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/5.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/6.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/6.json index b66fff04b..fbedc213f 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/6.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/6.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/7.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/7.json index f04e7ef98..b2bd2ec1f 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/7.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/7.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/8.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/8.json index 843c9d279..41ff2dd68 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/8.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotersDoNotExist/8.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/0.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/0.json index c7c47b4ea..54f84efb0 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/0.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/0.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/1.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/1.json index 1a8a6f637..4701c536c 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/1.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/1.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/10.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/10.json index ed3b07505..e1edfc8c4 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/10.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/10.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/11.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/11.json index 328416124..701591d2e 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/11.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/11.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/12.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/12.json index f08102347..a6c2c0e81 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/12.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/12.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/13.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/13.json index cda215455..495d46c48 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/13.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/13.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/14.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/14.json index 8c94ded7a..defe5a6ec 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/14.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/14.json @@ -22,7 +22,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/15.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/15.json index 6147534ae..724490a95 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/15.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/15.json @@ -35,11 +35,13 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" }, { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/16.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/16.json index 508262049..d14662f65 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/16.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/16.json @@ -35,11 +35,13 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" }, { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/2.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/2.json index 35368760f..e1a1af60f 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/2.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/2.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/3.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/3.json index fe8885ec3..1c6abc98a 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/3.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/3.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/4.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/4.json index 748c2dd23..6d50a864b 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/4.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/4.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/5.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/5.json index aea4afb25..3d1a44b9d 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/5.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/5.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/6.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/6.json index abaf0dd6e..18641e99e 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/6.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/6.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/7.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/7.json index 570ea05e2..aa6c7171d 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/7.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/7.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/8.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/8.json index c25ae5280..8c8873bc7 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/8.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/8.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/9.json b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/9.json index 87406bd45..3bb33f1a6 100644 --- a/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/9.json +++ b/crates/amaru-ledger/tests/data/phase-one/fail/VotingOnExpiredGovAction/9.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b01", - "validUntil": 0 + "validUntil": 0, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-key.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-key.json index a3ee5a6da..c1b49b21d 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-key.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-key.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-script.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-script.json index be925fb1b..a5ad4072e 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-script.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-committee-hot-script.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-key.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-key.json index ea7793ea6..963a4cde1 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-key.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-key.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-script.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-script.json index d41075465..d6e014067 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-script.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-drep-script.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-stake-pool.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-stake-pool.json index da358b7fb..3ecc63bdd 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-stake-pool.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-action-expiring-this-epoch-stake-pool.json @@ -24,7 +24,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-elected-member-protocol-version-11.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-elected-member-protocol-version-11.json index 2df554876..6cb309c90 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-elected-member-protocol-version-11.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-elected-member-protocol-version-11.json @@ -34,7 +34,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key-shared-with-unelected-member.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key-shared-with-unelected-member.json index e629a6c61..c99778dac 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key-shared-with-unelected-member.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key-shared-with-unelected-member.json @@ -39,7 +39,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key.json index bc92dc640..83978318e 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-key.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-script.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-script.json index 89c9725a9..bf4b7661b 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-script.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-hot-script.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-member-with-expired-term.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-member-with-expired-term.json index 19c709b50..1b50fc7c1 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-member-with-expired-term.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-member-with-expired-term.json @@ -34,7 +34,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 1 + "validUntil": 1, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-new-constitution.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-new-constitution.json new file mode 100644 index 000000000..a086e2ea3 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-new-constitution.json @@ -0,0 +1,49 @@ +{ + "title": "vote cast by a committee member on a new constitution", + "description": "The committee's say extends to the constitution it is charged with upholding.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "8258209bba1ec996e9f3e37fcc36f6d5ac872320660b109ddac964e664779980fc611300", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [], + "accounts": [], + "dreps": [], + "committee": [ + { + "coldCredential": "8200581cecc3093b061a9ed426cd9956161fc48d4ed1ac58dc4aaed7e1ce1830", + "hotCredential": "8200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8", + "validUntil": 200 + } + ], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8305f68282781f68747470733a2f2f616d6172752e746573742f666978747572652e6a736f6e58200000000000000000000000000000000000000000000000000000000000000000f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d90102818258209bba1ec996e9f3e37fcc36f6d5ac872320660b109ddac964e664779980fc6113000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db1258404b2b1da57dc207d56b3b6d65258f90f4da0798817b1b35fefcfbec59121e6647956797709357aa033848a773b1d84d268b4296f1f9008bbd3f97b14e9b53cd02f5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-treasury-withdrawals.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-treasury-withdrawals.json new file mode 100644 index 000000000..0a1923906 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-treasury-withdrawals.json @@ -0,0 +1,49 @@ +{ + "title": "vote cast by a committee member on a treasury withdrawal", + "description": "The committee has a say over every action but the two aimed at itself.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "825820e0483612e52e41bc15ffa584e258708d4067331695749d8aa434cebc2fd3fb9c00", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [], + "accounts": [], + "dreps": [], + "committee": [ + { + "coldCredential": "8200581cecc3093b061a9ed426cd9956161fc48d4ed1ac58dc4aaed7e1ce1830", + "hotCredential": "8200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8", + "validUntil": 200 + } + ], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8302a1581de093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd81a000f4240f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d9010281825820e0483612e52e41bc15ffa584e258708d4067331695749d8aa434cebc2fd3fb9c000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db125840f1dc314797f86be5e3af6ebe2bd5d51f74165412ebd238ad14a12bb971790f31b4c8c0e6ce5d8365e908c77aad8033050436bdb6d1e1c37ff4c8bf875b085308f5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-unelected-member.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-unelected-member.json index e4984df88..1a547a14a 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-unelected-member.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-committee-unelected-member.json @@ -28,7 +28,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-expired-registration.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-expired-registration.json index 256df6196..707e0d84e 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-expired-registration.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-expired-registration.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-key-credential.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-key-credential.json index cd037d34c..25aa2eb11 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-key-credential.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-key-credential.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-no-confidence.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-no-confidence.json new file mode 100644 index 000000000..6c584cffd --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-no-confidence.json @@ -0,0 +1,56 @@ +{ + "title": "vote cast by a drep on a motion of no confidence", + "description": "Dreps have a say over every kind of governance action, this one included.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "8258209e5279ec33a950772da723b03be556ae49ff7f7a444e4834ff92e0a665d3e53e00", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [], + "accounts": [], + "dreps": [ + { + "credential": "8200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8", + "deposit": 500000000, + "registeredAt": { + "transaction": { + "slot": 0, + "transactionIndex": 0 + }, + "certificateIndex": 0 + }, + "validUntil": 1000 + } + ], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8203f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d90102818258209e5279ec33a950772da723b03be556ae49ff7f7a444e4834ff92e0a665d3e53e000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18202581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db12584027007432bd384de661d75a2b187c449ef00109430100573f25461d90265fc08f9f433daa32c24d41b8ae262df2b0a73522d4b85f67f110e4695f6a335c66df0ff5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-protocol-version-11.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-protocol-version-11.json index c6f3a90f3..5189b30ae 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-protocol-version-11.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-protocol-version-11.json @@ -41,7 +41,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-treasury-withdrawals.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-treasury-withdrawals.json new file mode 100644 index 000000000..6ce1a52a6 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-drep-treasury-withdrawals.json @@ -0,0 +1,56 @@ +{ + "title": "vote cast by a drep on a treasury withdrawal", + "description": "The action stake pools are barred from is one dreps carry a threshold on.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "8258209c37bdc1e4676c7fc9ff2e0adc4d24b793e13d878c28ac406d47757fdd42f07300", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [], + "accounts": [], + "dreps": [ + { + "credential": "8200581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8", + "deposit": 500000000, + "registeredAt": { + "transaction": { + "slot": 0, + "transactionIndex": 0 + }, + "certificateIndex": 0 + }, + "validUntil": 1000 + } + ], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8302a1581de093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd81a000f4240f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d90102818258209c37bdc1e4676c7fc9ff2e0adc4d24b793e13d878c28ac406d47757fdd42f073000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18202581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db125840cf55f310f371efff5f6f6e15cf6e03721e6b5c776078f87fd7ac6099fd008aad261a71a4cd95fffa80d3d5220076cc0606b8b8d0bae9678390d1c9b1e0ec3f00f5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-script-credential.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-script-credential.json index af2425c7e..259de99fd 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-script-credential.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-script-credential.json @@ -35,7 +35,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-hard-fork-initiation.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-hard-fork-initiation.json new file mode 100644 index 000000000..c405b8b36 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-hard-fork-initiation.json @@ -0,0 +1,45 @@ +{ + "title": "vote cast by a stake pool on a hard fork initiation", + "description": "Stake pools carry a threshold on a hard fork, which cannot happen without the nodes running it.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "8258200d25d6f5993b3a0155897e8d97d54795f5945dac5a2076383e7e05e8232c452200", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8301f6820b00" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d90102818258200d25d6f5993b3a0155897e8d97d54795f5945dac5a2076383e7e05e8232c4522000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db12584086c5b8427f87732f3000b8670c98771ad90ec12666c6cba92fe6bdc8d60fc74c11b8a5ac094fbc3d3f556a884e1f464d42877c00d0144818f4af9bbf667b8c04f5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-no-confidence.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-no-confidence.json new file mode 100644 index 000000000..2ee400584 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-no-confidence.json @@ -0,0 +1,45 @@ +{ + "title": "vote cast by a stake pool on a motion of no confidence", + "description": "Stake pools carry a threshold on the action that dissolves the committee.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "82582035d11e5dcaf28ddff61718afe2a1b07afc12b8d1bcd20f0f017930b88db1c34e00", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8203f6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d901028182582035d11e5dcaf28ddff61718afe2a1b07afc12b8d1bcd20f0f017930b88db1c34e000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db125840494852f86ea27c9a68db028e9b8c998a4be893712dc4a29d4f5dedc4f8030a41e46d2d0bf451b1aa91773a672254a91009db5c610d9471b01b056e0facdaa00cf5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-parameter-change-security-group.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-parameter-change-security-group.json new file mode 100644 index 000000000..39ef4e9c6 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-parameter-change-security-group.json @@ -0,0 +1,45 @@ +{ + "title": "vote cast by a stake pool on a parameter change within the security group", + "description": "A change to the minimum fee coefficient, which is a security group parameter.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "825820f264b1a1f0a418cf7400d3431b061992ae045b24e5b790fd74165c51bbd48d1000", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8400f6a100182cf6" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d9010281825820f264b1a1f0a418cf7400d3431b061992ae045b24e5b790fd74165c51bbd48d10000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db1258401bae2da00d1fadf2f0d4611120d77062d630fe9ba15df1043458b1d5c32a73dcd19c83af0423d8d29fd7b686608744ad218b2b7423b76811a5dd2f00c37df40df5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-update-committee.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-update-committee.json new file mode 100644 index 000000000..cb577f262 --- /dev/null +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool-update-committee.json @@ -0,0 +1,45 @@ +{ + "title": "vote cast by a stake pool on a committee update", + "description": "Stake pools carry a threshold on the action that reshapes the committee.", + "network": "preprod", + "eraHistory": { + "$ref": "common/eraHistory/preprod-conway.json" + }, + "protocolParameters": { + "$ref": "common/protocolParameters/preprod-conway-v10.json" + }, + "initialState": { + "utxo": [ + { + "input": "825820467a6bb5b317f10d7ed9acd46560f56fe75a00efa98165fe890d0323e42b09cc00", + "output": "a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a004c4b40" + } + ], + "pools": [ + "93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8" + ], + "accounts": [], + "dreps": [], + "committee": [], + "proposals": [ + { + "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", + "validUntil": 100, + "govAction": "8504f6d9010280a0d81e820102" + } + ], + "governanceActivity": { + "consecutiveDormantEpochs": 0 + }, + "pots": { + "treasury": 0, + "reserves": 0 + } + }, + "point": { + "slot": 0, + "transactionIndex": 0 + }, + "transaction": "84a500d9010281825820467a6bb5b317f10d7ed9acd46560f56fe75a00efa98165fe890d0323e42b09cc000181a200581d6093c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8011a00493e00021a00030d400f0013a18204581c93c191b1094746961f6f00fba27f3d8eff6a66490baf806d4e179fd8a18258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b008201f6a100d90102818258202152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db1258400529ad07a6c1212d6de467ef311efeb226801957ab204cd3f59632fcdeb957a7d353d7f29248093a2219a938d31ef8851cfe13437439e49d057d1559b8d1de06f5f6", + "expected": "Pass" +} diff --git a/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool.json b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool.json index 839414115..88612d2b1 100644 --- a/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool.json +++ b/crates/amaru-ledger/tests/data/phase-one/pass/vote-stake-pool.json @@ -24,7 +24,8 @@ "proposals": [ { "id": "8258207e2b9d5f1a3c7e5b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b00", - "validUntil": 100 + "validUntil": 100, + "govAction": "8106" } ], "governanceActivity": { diff --git a/crates/amaru-ledger/tests/data/phase-one/schema.json b/crates/amaru-ledger/tests/data/phase-one/schema.json index b3a65fe75..e92dc3007 100644 --- a/crates/amaru-ledger/tests/data/phase-one/schema.json +++ b/crates/amaru-ledger/tests/data/phase-one/schema.json @@ -267,7 +267,7 @@ }, "Proposal": { "type": "object", - "required": ["id", "validUntil"], + "required": ["id", "validUntil", "govAction"], "properties": { "id": { "$ref": "#/$defs/HexCbor", @@ -277,6 +277,10 @@ "type": "integer", "minimum": 0, "description": "Last epoch in which a vote on the action still counts." + }, + "govAction": { + "$ref": "#/$defs/HexCbor", + "description": "Hex-encoded CBOR of GovAction. Decides which voters may vote on the proposal at all, so it is required even when a case does not turn on it; use \"8106\" (Information) for the action no voter is barred from." } } }, diff --git a/crates/amaru-ledger/tests/data/rules-conformance.failures.toml b/crates/amaru-ledger/tests/data/rules-conformance.failures.toml index 9b2352af3..ae3fbd16b 100644 --- a/crates/amaru-ledger/tests/data/rules-conformance.failures.toml +++ b/crates/amaru-ledger/tests/data/rules-conformance.failures.toml @@ -22,9 +22,6 @@ "conway/fail-deleg-delegate-unregistered-stake-credentials/0" = "Expected failure, got success" "conway/fail-deleg-delegate-vote-of-unregistered-stake-credentials/0" = "Expected failure, got success" "conway/fail-deleg-with-non-zero-reward-balance/0" = "Expected failure, got success" -"conway/fail-gov-committee-member-can-not-vote-on-noconfidence-action/0" = "Expected failure, got success" -"conway/fail-gov-committee-member-can-not-vote-on-updatecommittee-action/0" = "Expected failure, got success" -"conway/fail-gov-committee-member-mixed-with-other-voters-can-not-vote-on-updatecommittee-action/0" = "Expected failure, got success" "conway/fail-gov-empty-prevgovid-after-the-first-constitution-was-enacted/0" = "Expected failure, got success" "conway/fail-gov-expired-gov-actions/0" = "Expected failure, got success" "conway/fail-gov-invalid-index-in-govpurposeid/0" = "Expected failure, got success"