Skip to content

Commit

Permalink
chore(ethereum-lc): properly generate test data
Browse files Browse the repository at this point in the history
Signed-off-by: aeryz <[email protected]>
  • Loading branch information
aeryz committed Nov 1, 2023
1 parent 12f06d0 commit 711a9db
Show file tree
Hide file tree
Showing 23 changed files with 12,956 additions and 13,136 deletions.
10 changes: 4 additions & 6 deletions light-clients/ethereum-light-client/ethereum-light-client.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
# TODO(aeryz): add this in case we need a limit
# if [[ $A -eq 10 ]]; then
# break;
# fi;
# fi;
I=$((I+1))
TARGET_SLOT=$(echo "$line" | jq .client_message.data.consensus_update.attested_header.beacon.slot -r)
echo "processing line: $I, slot: $TARGET_SLOT"
Expand All @@ -38,10 +39,7 @@
filename="finality_update-$filename.json"
fi
echo "$line" | jq > "$OUTPUT_PATH/$filename"
I=$((I+1))
echo "$line" | jq .client_message.data > "$UPDATES_PATH/$filename"
done
'';
};
Expand Down
21 changes: 16 additions & 5 deletions light-clients/ethereum-light-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ mod test {
revision_height: 3577184,
};

const UPDATES_DIR_PATH: &str = "test/updates/";

fn setup() {}

#[test]
#[ignore = "broken test data"]
fn query_status_returns_active() {
Expand Down Expand Up @@ -687,11 +691,18 @@ mod test {
&INITIAL_CONSENSUS_STATE_HEIGHT,
);

let updates: &[ethereum::header::Header<Mainnet>] =
&[
serde_json::from_str(include_str!("./test/updates/finality_update_3577216.json"))
.unwrap(),
];
let updates: &[ethereum::header::Header<Mainnet>] = &[
serde_json::from_str(include_str!("./test/updates/finality_update-3577216.json"))
.unwrap(),
serde_json::from_str(include_str!("./test/updates/finality_update-3577248.json"))
.unwrap(),
serde_json::from_str(include_str!("./test/updates/finality_update-3577280.json"))
.unwrap(),
serde_json::from_str(include_str!("./test/updates/finality_update-3577284.json"))
.unwrap(),
serde_json::from_str(include_str!("./test/updates/finality_update-3577312.json"))
.unwrap(),
];

for update in updates {
let mut env = mock_env();
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 711a9db

Please sign in to comment.