@@ -85,8 +85,8 @@ impl SecurityTetraplet {
85
85
) ]
86
86
#[ cfg_attr( feature = "rkyv" , archive( check_bytes) ) ]
87
87
pub struct CallParameters {
88
- /// Peer id of the AIR script initiator .
89
- pub init_peer_id : String ,
88
+ /// Parameters of the particle that caused this call .
89
+ pub particle : ParticleParameters ,
90
90
91
91
/// Id of the current service.
92
92
pub service_id : String ,
@@ -100,13 +100,40 @@ pub struct CallParameters {
100
100
/// PeerId of the worker who hosts this service.
101
101
pub worker_id : String ,
102
102
103
- /// Id of the particle which execution resulted a call this service.
104
- pub particle_id : String ,
105
-
106
103
/// Security tetraplets which described origin of the arguments.
107
104
pub tetraplets : Vec < Vec < SecurityTetraplet > > ,
108
105
}
109
106
107
+ #[ cfg_attr( all( target_arch = "wasm32" , feature = "marine-abi" ) , marine) ]
108
+ #[ derive( Clone , PartialEq , Default , Eq , Debug , Serialize , Deserialize ) ]
109
+ #[ cfg_attr(
110
+ feature = "rkyv" ,
111
+ derive( :: rkyv:: Archive , :: rkyv:: Serialize , :: rkyv:: Deserialize )
112
+ ) ]
113
+ #[ cfg_attr( feature = "rkyv" , archive( check_bytes) ) ]
114
+ pub struct ParticleParameters {
115
+ /// Id of the particle which execution resulted a call this service.
116
+ pub id : String ,
117
+
118
+ /// Peer id of the AIR script initiator.
119
+ pub init_peer_id : String ,
120
+
121
+ /// Unix timestamp of the particle start time.
122
+ pub timestamp : u64 ,
123
+
124
+ /// Time to live for this particle in milliseconds.
125
+ pub ttl : u32 ,
126
+
127
+ /// AIR script in this particle.
128
+ pub script : String ,
129
+
130
+ /// Signature made by particle initiator -- init_peer_id.
131
+ pub signature : Vec < u8 > ,
132
+
133
+ /// particle.signature signed by host_id -- used for FS access.
134
+ pub token : String ,
135
+ }
136
+
110
137
use std:: fmt;
111
138
impl fmt:: Display for SecurityTetraplet {
112
139
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -136,7 +163,7 @@ pub fn get_call_parameters() -> CallParameters {
136
163
}
137
164
138
165
#[ cfg( all( feature = "marine-abi" , target_arch = "wasm32" ) ) ]
139
- #[ link( wasm_import_module = "__marine_host_api_v1 " ) ]
166
+ #[ link( wasm_import_module = "__marine_host_api_v2 " ) ]
140
167
#[ allow( improper_ctypes) ]
141
168
extern "C" {
142
169
// returns serialized current call parameters
0 commit comments