Skip to content

Commit

Permalink
Merge pull request #2113 from eqlabs/chris/test-track-sync
Browse files Browse the repository at this point in the history
tracking sync test
  • Loading branch information
CHr15F0x authored Jul 9, 2024
2 parents 6af91a9 + 54e596b commit 6b3e462
Show file tree
Hide file tree
Showing 19 changed files with 1,219 additions and 521 deletions.
29 changes: 23 additions & 6 deletions crates/common/src/class_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub struct Sierra<'a> {
impl<T> Dummy<T> for Sierra<'_> {
fn dummy_with_rng<R: Rng + ?Sized>(_: &T, rng: &mut R) -> Self {
Self {
abi: Cow::Owned(Faker.fake_with_rng(rng)),
sierra_program: Faker.fake_with_rng(rng),
abi: "[]".into(),
sierra_program: vec![],
contract_class_version: "0.1.0".into(),
entry_points_by_type: Faker.fake_with_rng(rng),
}
Expand All @@ -58,11 +58,28 @@ pub struct Cairo<'a> {

impl<T> Dummy<T> for Cairo<'_> {
fn dummy_with_rng<R: Rng + ?Sized>(_: &T, rng: &mut R) -> Self {
let abi = serde_json::Value::Object(Faker.fake_with_rng(rng));
let program = serde_json::Value::Object(Faker.fake_with_rng(rng));
Self {
abi: Cow::Owned(serde_json::value::to_raw_value(&abi).unwrap()),
program: Cow::Owned(serde_json::value::to_raw_value(&program).unwrap()),
abi: Cow::Owned(
RawValue::from_string("[]".into()).unwrap(),
),
program: Cow::Owned(
RawValue::from_string(
r#"
{
"attributes": [],
"builtins": [],
"data": [],
"debug_info": null,
"hints": {},
"identifiers": {},
"main_scope": "__main__",
"prime": "0x800000000000011000000000000000000000000000000000000000000000001",
"reference_manager": {}
}
"#.into()
)
.unwrap(),
),
entry_points_by_type: Faker.fake_with_rng(rng),
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/p2p/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod conv;
pub mod peer_agnostic;
pub mod peer_aware;
pub mod types;
8 changes: 2 additions & 6 deletions crates/p2p/src/client/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ impl ToDto<p2p_proto::receipt::Receipt> for (&TransactionVariant, Receipt) {
}

#[cfg(test)]
impl ToDto<p2p_proto::receipt::Receipt>
for (&TransactionVariant, crate::client::peer_agnostic::Receipt)
{
impl ToDto<p2p_proto::receipt::Receipt> for (&TransactionVariant, crate::client::types::Receipt) {
fn to_dto(self) -> p2p_proto::receipt::Receipt {
let (t, r) = self;
(
Expand Down Expand Up @@ -626,9 +624,7 @@ impl TryFromDto<p2p_proto::transaction::Transaction> for TransactionVariant {
}
}

impl TryFrom<(p2p_proto::receipt::Receipt, TransactionIndex)>
for crate::client::peer_agnostic::Receipt
{
impl TryFrom<(p2p_proto::receipt::Receipt, TransactionIndex)> for crate::client::types::Receipt {
type Error = anyhow::Error;

fn try_from(
Expand Down
Loading

0 comments on commit 6b3e462

Please sign in to comment.