Skip to content

Commit 2b8e6c7

Browse files
committed
Comments and fixes
1 parent fdc9206 commit 2b8e6c7

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

toolkit/offchain/src/csl.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,7 @@ mod tests {
710710
validator: OgmiosValidatorIndex::new(2, "spend"),
711711
budget: OgmiosBudget::new(12, 22),
712712
},
713-
])
714-
.expect("Should succeed");
713+
]);
715714

716715
let expected = ScriptExUnits {
717716
mint_ex_units: vec![

toolkit/offchain/src/reserve/init.rs

+16-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ use ogmios_client::{
3636
query_network::QueryNetwork,
3737
transactions::{OgmiosEvaluateTransactionResponse, Transactions},
3838
};
39-
use raw_scripts::{ILLIQUID_CIRCULATION_SUPPLY_VALIDATOR, RESERVE_AUTH_POLICY, RESERVE_VALIDATOR};
39+
use raw_scripts::{
40+
ScriptId, ILLIQUID_CIRCULATION_SUPPLY_VALIDATOR, RESERVE_AUTH_POLICY, RESERVE_VALIDATOR,
41+
};
4042
use sidechain_domain::{McTxHash, UtxoId};
4143
use std::collections::HashMap;
4244

@@ -49,14 +51,20 @@ pub async fn init_reserve_management<
4951
client: &T,
5052
await_tx: &A,
5153
) -> anyhow::Result<Vec<McTxHash>> {
52-
let reserve_validator =
53-
ScriptData::new("Reserve Management Validator", RESERVE_VALIDATOR.to_vec(), 28);
54-
let reserve_policy =
55-
ScriptData::new("Reserve Management Policy", RESERVE_AUTH_POLICY.to_vec(), 29);
54+
let reserve_validator = ScriptData::new(
55+
"Reserve Management Validator",
56+
RESERVE_VALIDATOR.to_vec(),
57+
ScriptId::ReserveValidator,
58+
);
59+
let reserve_policy = ScriptData::new(
60+
"Reserve Management Policy",
61+
RESERVE_AUTH_POLICY.to_vec(),
62+
ScriptId::ReserveAuthPolicy,
63+
);
5664
let ics_validator = ScriptData::new(
5765
"Illiquid Circulation Validator",
5866
ILLIQUID_CIRCULATION_SUPPLY_VALIDATOR.to_vec(),
59-
30,
67+
ScriptId::IlliquidCirculationSupplyValidator,
6068
);
6169
Ok(vec![
6270
initialize_script(reserve_validator, genesis_utxo, payment_key, client, await_tx).await?,
@@ -75,10 +83,10 @@ struct ScriptData {
7583
}
7684

7785
impl ScriptData {
78-
fn new(name: &str, raw_bytes: Vec<u8>, id: u16) -> Self {
86+
fn new(name: &str, raw_bytes: Vec<u8>, id: ScriptId) -> Self {
7987
let plutus_script = PlutusScript::from_wrapped_cbor(&raw_bytes, LanguageKind::PlutusV2)
8088
.expect("Plutus script should be valid");
81-
Self { name: name.to_string(), plutus_script, id }
89+
Self { name: name.to_string(), plutus_script, id: id as u16 }
8290
}
8391

8492
fn applied_plutus_script(

0 commit comments

Comments
 (0)