You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.expect("!tw_transaction_compiler_pre_image_hashes returned nullptr");
221
+
222
+
let preimage:CompilerProto::PreSigningOutput =
223
+
deserialize(&preimage_data).expect("Coin entry returned an invalid output");
224
+
assert_eq!(preimage.error,SigningErrorType::OK);
225
+
assert!(preimage.error_message.is_empty());
226
+
assert_eq!(
227
+
preimage.data_hash.to_hex(),
228
+
"3bf2bf012750e35a16e3430b010f2eb2dda8309892309afce6714196d4912d56"// The AA user op hash
229
+
);
230
+
231
+
// Step 3: Compile transaction info
232
+
// Simulate signature, normally obtained from signature server
233
+
let signature = "4143bd278c97a4738846d9bc5756d0433bd062ea321cafb5ad3f7e3f68c68385277444f6fc851401ab319dad3756cd9e83c3ba9dfa502a69c43827fc2267f6d701".decode_hex().unwrap();
234
+
let public_key = "04ec6632291fbfe6b47826a1c4b195f8b112a7e147e8a5a15fb0f7d7de022652e7f65b97a57011c09527688e23c07ae9c83a2cae2e49edba226e7c43f0baa7296d".decode_hex().unwrap();
235
+
236
+
let signatures = TWDataVectorHelper::create([signature]);
237
+
let public_keys = TWDataVectorHelper::create([public_key]);
238
+
239
+
let input_data = TWDataHelper::create(serialize(&input).unwrap());
240
+
let output_data = TWDataHelper::wrap(unsafe{
241
+
tw_transaction_compiler_compile(
242
+
CoinType::Ethereumasu32,
243
+
input_data.ptr(),
244
+
signatures.ptr(),
245
+
public_keys.ptr(),
246
+
)
247
+
})
248
+
.to_vec()
249
+
.expect("!tw_transaction_compiler_compile returned nullptr");
250
+
251
+
let output:Proto::SigningOutput =
252
+
deserialize(&output_data).expect("Coin entry returned an invalid output");
0 commit comments