Skip to content

Commit 4a9e72e

Browse files
authoredFeb 20, 2024
feat(host api)!: rename json_path field in SecurityTetraplet to lambda to follow AquaVM naming (#158)
rename json_path to lambda
1 parent 8c7352e commit 4a9e72e

File tree

1 file changed

+10
-11
lines changed
  • crates/call-parameters/src

1 file changed

+10
-11
lines changed
 

‎crates/call-parameters/src/lib.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,22 @@ pub struct SecurityTetraplet {
3838
/// Name of a function that returned corresponding value.
3939
pub function_name: String,
4040

41-
/// Value was produced by applying this `json_path` to the output from `call_service`.
42-
// TODO: since it's not a json path anymore, it's needed to rename it to lambda
43-
pub json_path: String,
41+
/// Value was produced by applying this `lambda` to the output from `call_service`.
42+
pub lambda: String,
4443
}
4544

4645
impl SecurityTetraplet {
4746
pub fn new(
4847
peer_pk: impl Into<String>,
4948
service_id: impl Into<String>,
5049
function_name: impl Into<String>,
51-
json_path: impl Into<String>,
50+
lambda: impl Into<String>,
5251
) -> Self {
5352
Self {
5453
peer_pk: peer_pk.into(),
5554
service_id: service_id.into(),
5655
function_name: function_name.into(),
57-
json_path: json_path.into(),
56+
lambda: lambda.into(),
5857
}
5958
}
6059

@@ -66,13 +65,13 @@ impl SecurityTetraplet {
6665
peer_pk: init_peer_id.into(),
6766
service_id: String::new(),
6867
function_name: String::new(),
69-
// json path can't be applied to the string literals
70-
json_path: String::new(),
68+
// lambda can't be applied to the string literals
69+
lambda: String::new(),
7170
}
7271
}
7372

74-
pub fn add_lambda(&mut self, json_path: &str) {
75-
self.json_path.push_str(json_path)
73+
pub fn add_lambda(&mut self, lambda: &str) {
74+
self.lambda.push_str(lambda)
7675
}
7776
}
7877

@@ -139,8 +138,8 @@ impl fmt::Display for SecurityTetraplet {
139138
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
140139
write!(
141140
f,
142-
"peer_pk: {}, service_id: {}, function_name: {}, json_path: {}",
143-
self.peer_pk, self.service_id, self.function_name, self.json_path
141+
"peer_pk: {}, service_id: {}, function_name: {}, lambda: {}",
142+
self.peer_pk, self.service_id, self.function_name, self.lambda
144143
)
145144
}
146145
}

0 commit comments

Comments
 (0)