Skip to content

Commit 874b559

Browse files
committed
Fix V3 typos
1 parent 4e316ed commit 874b559

File tree

8 files changed

+33
-27
lines changed

8 files changed

+33
-27
lines changed

plutus-ledger-api/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
This changelog is based on [Keep A
55
Changelog](https://keepachangelog.com/en/1.1.0).
66

7+
## v2.2.0
8+
9+
### Changed
10+
11+
- Fixed typos in V3 types
12+
713
## v2.1.0
814

915
### Added

plutus-ledger-api/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plutus-ledger-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plutus-ledger-api"
3-
version = "2.1.0"
3+
version = "2.2.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "Plutus Ledger types and utilities implemented in Rust"

plutus-ledger-api/src/generators/correct/v3.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ use crate::{
2020
v3::{
2121
ratio::Rational,
2222
transaction::{
23-
ChangeParameters, ColdCommitteeCredential, Committee, Constitution, DRep,
23+
ChangedParameters, ColdCommitteeCredential, Committee, Constitution, DRep,
2424
DRepCredential, Delegatee, GovernanceAction, GovernanceActionId,
25-
HotCommitteeCredential, ProtocolProcedure, ProtocolVersion, ScriptContext, ScriptInfo,
25+
HotCommitteeCredential, ProposalProcedure, ProtocolVersion, ScriptContext, ScriptInfo,
2626
ScriptPurpose, TransactionInfo, TxCert, Vote, Voter,
2727
},
2828
},
@@ -145,16 +145,16 @@ pub fn arb_protocol_version() -> impl Strategy<Value = ProtocolVersion> {
145145
}
146146

147147
/// Strategy to generate change parameters
148-
pub fn arb_change_parameters() -> impl Strategy<Value = ChangeParameters> {
149-
arb_plutus_data().prop_map(ChangeParameters)
148+
pub fn arb_changed_parameters() -> impl Strategy<Value = ChangedParameters> {
149+
arb_plutus_data().prop_map(ChangedParameters)
150150
}
151151

152152
/// Strategy to generate governance actions
153153
pub fn arb_governance_action() -> impl Strategy<Value = GovernanceAction> {
154154
prop_oneof![
155155
(
156156
option::of(arb_governance_action_id()),
157-
arb_change_parameters(),
157+
arb_changed_parameters(),
158158
option::of(arb_script_hash())
159159
)
160160
.prop_map(|(g, c, s)| GovernanceAction::ParameterChange(g, c, s)),
@@ -183,9 +183,9 @@ pub fn arb_governance_action() -> impl Strategy<Value = GovernanceAction> {
183183
}
184184

185185
/// Strategy to generate protocol procedures
186-
pub fn arb_protocol_procedure() -> impl Strategy<Value = ProtocolProcedure> {
186+
pub fn arb_proposal_procedure() -> impl Strategy<Value = ProposalProcedure> {
187187
(arb_lovelace(), arb_credential(), arb_governance_action()).prop_map(|(l, c, g)| {
188-
ProtocolProcedure {
188+
ProposalProcedure {
189189
deposit: l,
190190
return_addr: c,
191191
governance_action: g,
@@ -201,7 +201,7 @@ pub fn arb_script_purpose() -> impl Strategy<Value = ScriptPurpose> {
201201
arb_credential().prop_map(ScriptPurpose::Rewarding),
202202
(arb_integer(), arb_tx_cert()).prop_map(|(i, c)| ScriptPurpose::Certifying(i, c)),
203203
arb_voter().prop_map(ScriptPurpose::Voting),
204-
(arb_integer(), arb_protocol_procedure()).prop_map(|(i, p)| ScriptPurpose::Proposing(i, p))
204+
(arb_integer(), arb_proposal_procedure()).prop_map(|(i, p)| ScriptPurpose::Proposing(i, p))
205205
]
206206
}
207207

@@ -214,7 +214,7 @@ pub fn arb_script_info() -> impl Strategy<Value = ScriptInfo> {
214214
arb_credential().prop_map(ScriptInfo::Rewarding),
215215
(arb_integer(), arb_tx_cert()).prop_map(|(i, c)| ScriptInfo::Certifying(i, c)),
216216
arb_voter().prop_map(ScriptInfo::Voting),
217-
(arb_integer(), arb_protocol_procedure()).prop_map(|(i, p)| ScriptInfo::Proposing(i, p))
217+
(arb_integer(), arb_proposal_procedure()).prop_map(|(i, p)| ScriptInfo::Proposing(i, p))
218218
]
219219
}
220220

@@ -239,7 +239,7 @@ pub fn arb_transaction_info() -> impl Strategy<Value = TransactionInfo> {
239239
arb_voter(),
240240
arb_assoc_map(arb_governance_action_id(), arb_vote()),
241241
),
242-
vec(arb_protocol_procedure(), 5),
242+
vec(arb_proposal_procedure(), 5),
243243
option::of(arb_lovelace()),
244244
option::of(arb_lovelace()),
245245
),
@@ -257,7 +257,7 @@ pub fn arb_transaction_info() -> impl Strategy<Value = TransactionInfo> {
257257
signatories,
258258
redeemers,
259259
datums,
260-
(id, votes, protocol_procedures, current_treasury_amount, treasury_donation),
260+
(id, votes, proposal_procedures, current_treasury_amount, treasury_donation),
261261
)| {
262262
TransactionInfo {
263263
inputs,
@@ -273,7 +273,7 @@ pub fn arb_transaction_info() -> impl Strategy<Value = TransactionInfo> {
273273
datums,
274274
id,
275275
votes,
276-
protocol_procedures,
276+
proposal_procedures,
277277
current_treasury_amount,
278278
treasury_donation,
279279
}

plutus-ledger-api/src/v3/transaction.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub struct ProtocolVersion {
162162
#[is_plutus_data_derive_strategy = "Newtype"]
163163
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
164164
#[cfg_attr(feature = "lbf", derive(Json))]
165-
pub struct ChangeParameters(pub PlutusData);
165+
pub struct ChangedParameters(pub PlutusData);
166166

167167
#[derive(Clone, Debug, PartialEq, Eq, IsPlutusData)]
168168
#[is_plutus_data_derive_strategy = "Constr"]
@@ -172,7 +172,7 @@ pub enum GovernanceAction {
172172
/// Propose to change the protocol parameters
173173
ParameterChange(
174174
Option<GovernanceActionId>,
175-
ChangeParameters,
175+
ChangedParameters,
176176
// The hash of the constitution script
177177
Option<ScriptHash>,
178178
),
@@ -205,7 +205,7 @@ pub enum GovernanceAction {
205205
#[is_plutus_data_derive_strategy = "Constr"]
206206
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207207
#[cfg_attr(feature = "lbf", derive(Json))]
208-
pub struct ProtocolProcedure {
208+
pub struct ProposalProcedure {
209209
pub deposit: Lovelace,
210210
pub return_addr: Credential,
211211
pub governance_action: GovernanceAction,
@@ -226,9 +226,9 @@ pub enum ScriptPurpose {
226226
),
227227
Voting(Voter),
228228
Proposing(
229-
/// 0-based index of the given `ProposalProcedure` in `protocol_procedures` field of the `TransactionInfo`
229+
/// 0-based index of the given `ProposalProcedure` in `proposal_procedures` field of the `TransactionInfo`
230230
BigInt,
231-
ProtocolProcedure,
231+
ProposalProcedure,
232232
),
233233
}
234234

@@ -242,7 +242,7 @@ pub enum ScriptInfo {
242242
Rewarding(Credential),
243243
Certifying(BigInt, TxCert),
244244
Voting(Voter),
245-
Proposing(BigInt, ProtocolProcedure),
245+
Proposing(BigInt, ProposalProcedure),
246246
}
247247

248248
#[derive(Clone, Debug, PartialEq, Eq, IsPlutusData)]
@@ -263,7 +263,7 @@ pub struct TransactionInfo {
263263
pub datums: AssocMap<DatumHash, Datum>,
264264
pub id: TransactionHash,
265265
pub votes: AssocMap<Voter, AssocMap<GovernanceActionId, Vote>>,
266-
pub protocol_procedures: Vec<ProtocolProcedure>,
266+
pub proposal_procedures: Vec<ProposalProcedure>,
267267
pub current_treasury_amount: Option<Lovelace>,
268268
pub treasury_donation: Option<Lovelace>,
269269
}

plutus-ledger-api/tests/lbf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ mod lb_json_roundtrip_tests {
227227
}
228228

229229
#[test]
230-
fn test_change_parameters(val in arb_change_parameters()) {
230+
fn test_changed_parameters(val in arb_changed_parameters()) {
231231
assert_eq!(val, from_to_json(&val)?)
232232
}
233233

@@ -238,7 +238,7 @@ mod lb_json_roundtrip_tests {
238238
}
239239

240240
#[test]
241-
fn test_protocol_procedure(val in arb_protocol_procedure()) {
241+
fn test_proposal_procedure(val in arb_proposal_procedure()) {
242242
assert_eq!(val, from_to_json(&val)?)
243243
}
244244

plutus-ledger-api/tests/plutus_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ mod plutusdata_roundtrip_tests {
493493

494494

495495
#[test]
496-
fn v3_change_parameters(val in arb_change_parameters()) {
496+
fn v3_changed_parameters(val in arb_changed_parameters()) {
497497
assert_eq!(val, from_to_plutus_data(&val)?);
498498
}
499499

@@ -504,7 +504,7 @@ mod plutusdata_roundtrip_tests {
504504
}
505505

506506
#[test]
507-
fn v3_protocol_procedure(val in arb_protocol_procedure()) {
507+
fn v3_proposal_procedure(val in arb_proposal_procedure()) {
508508
assert_eq!(val, from_to_plutus_data(&val)?);
509509
}
510510

plutus-ledger-api/tests/serde.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ mod serde_roundtrip_tests {
225225
}
226226

227227
#[test]
228-
fn test_change_parameters(val in arb_change_parameters()) {
228+
fn test_changed_parameters(val in arb_changed_parameters()) {
229229
assert_eq!(val, from_to_json(&val)?)
230230
}
231231

@@ -236,7 +236,7 @@ mod serde_roundtrip_tests {
236236
}
237237

238238
#[test]
239-
fn test_protocol_procedure(val in arb_protocol_procedure()) {
239+
fn test_proposal_procedure(val in arb_proposal_procedure()) {
240240
assert_eq!(val, from_to_json(&val)?)
241241
}
242242

0 commit comments

Comments
 (0)