Skip to content

Commit

Permalink
fix: implement Default EVMoutput
Browse files Browse the repository at this point in the history
success was always false due to its
default value
  • Loading branch information
obatirou committed Jul 16, 2024
1 parent bb9ce58 commit 9f99151
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/ef-testing/src/evm_sequencer/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ pub fn to_broadcasted_starknet_transaction(

// Compute the hash on elements and sign it
let transaction_hash = compute_hash_on_elements(&data_to_hash);
let signature_starknet = RELAYER_SIGNING_KEY
let signature_relayer = RELAYER_SIGNING_KEY
.sign(&transaction_hash)
.expect("Signature starknet failed");

let signature_starknet = vec![signature_starknet.r, signature_starknet.s];
let signature_relayer = vec![signature_relayer.r, signature_relayer.s];

let request = BroadcastedInvokeTransaction::V1(BroadcastedInvokeTransactionV1 {
max_fee: Felt::ZERO,
signature: signature_starknet,
signature: signature_relayer,
nonce: relayer_nonce,
sender_address: (*RELAYER_ADDRESS.0.key()).into(),
calldata: execute_calldata,
Expand Down
12 changes: 11 additions & 1 deletion crates/ef-testing/src/models/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tracing::{error, info, warn};

use std::convert::TryFrom;

#[derive(Default, Debug)]
#[derive(Debug)]
pub struct EVMOutput {
pub return_data: Vec<u8>,
pub gas_used: u64,
Expand All @@ -24,6 +24,16 @@ impl EVMOutput {
}
}

impl Default for EVMOutput {
fn default() -> Self {
Self {
return_data: vec![],
gas_used: 0,
success: true,
}
}
}

impl TryFrom<&EventData> for EVMOutput {
type Error = eyre::Report;

Expand Down

0 comments on commit 9f99151

Please sign in to comment.