Skip to content

Commit c15037a

Browse files
committed
pass environment to parameter correlations
1 parent 7ac5074 commit c15037a

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

contracts/ledgerlens-score/src/event_causality.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,23 @@ impl EventCausality {
121121
/// Workflow: param_change_proposed → param_change_executed/param_change_vetoed
122122
///
123123
/// # Parameters
124+
/// - `env`: The Soroban environment that owns `param_key`
124125
/// - `proposal_id`: Unique proposal identifier
125126
/// - `param_key`: The parameter key being changed
126127
/// - `timestamp`: The proposal timestamp
127128
pub fn parameter_change_correlation_id(
129+
env: &Env,
128130
proposal_id: u64,
129131
param_key: &Symbol,
130132
timestamp: u64,
131133
) -> CorrelationId {
132-
let env = param_key.env().clone();
133134
Self::hash_bytes(
134-
&env,
135+
env,
135136
&[
136-
Bytes::from_slice(&env, b"param_change"),
137-
Bytes::from_array(&env, &proposal_id.to_le_bytes()),
138-
param_key.to_xdr(&env),
139-
Bytes::from_array(&env, &timestamp.to_le_bytes()),
137+
Bytes::from_slice(env, b"param_change"),
138+
Bytes::from_array(env, &proposal_id.to_le_bytes()),
139+
param_key.to_xdr(env),
140+
Bytes::from_array(env, &timestamp.to_le_bytes()),
140141
],
141142
)
142143
}

0 commit comments

Comments
 (0)