Skip to content

Commit

Permalink
ENG-578: IT (Part 3) - Validation (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh authored Feb 20, 2024
1 parent 61109ae commit 7d608b0
Show file tree
Hide file tree
Showing 17 changed files with 1,160 additions and 540 deletions.
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pin-project = "1.1.2"
prometheus = "0.13"
prost = { version = "0.11" }
quickcheck = "1"
quickcheck_async = "0.1"
quickcheck_macros = "1"
rand = "0.8"
rand_chacha = "0.3"
Expand Down
3 changes: 1 addition & 2 deletions fendermint/testing/contract-test/tests/staking/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ impl StateMachine for StakingMachine {
}

fn new_system(&self, state: &Self::State) -> Self::System {
let rt: tokio::runtime::Runtime =
tokio::runtime::Runtime::new().expect("create tokio runtime for init");
let rt = tokio::runtime::Runtime::new().expect("create tokio runtime for init");

let (mut exec_state, _) = rt
.block_on(fendermint_contract_test::init_exec_state(
Expand Down
5 changes: 5 additions & 0 deletions fendermint/testing/materializer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ serde_with = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
tendermint-rpc = { workspace = true }
tracing = { workspace = true }

lazy_static = { workspace = true, optional = true }
arbitrary = { workspace = true, optional = true }
Expand All @@ -32,10 +33,14 @@ fendermint_testing = { path = "..", optional = true }


[dev-dependencies]
env_logger = { workspace = true }
futures = { workspace = true }
quickcheck = { workspace = true }
quickcheck_async = { workspace = true }
quickcheck_macros = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }

# Enable arb on self for tests.
Expand Down
110 changes: 54 additions & 56 deletions fendermint/testing/materializer/golden/manifest/json/manifest.json
Original file line number Diff line number Diff line change
@@ -1,99 +1,97 @@
{
"accounts": {
"AJxB": {},
"Aj0I_t": {},
"TeBcA": {},
"ccXUc3": {}
"4rENv3UF": {},
"6zLbz2": {},
"JExQ": {},
"JYWv_Qsa": {},
"RrX": {}
},
"rootnet": {
"type": "External",
"deployment": {
"type": "New",
"deployer": "Aj0I_t"
"deployer": "JExQ"
},
"urls": [
"https://e4gapevf.api.calibration.node.glif.io/rpc/v1",
"https://ypa.api.calibration.node.glif.io/rpc/v1",
"https://m4662lst.api.calibration.node.glif.io/rpc/v1"
"https://0hjym.api.calibration.node.glif.io/rpc/v1",
"https://4c1xblz.api.calibration.node.glif.io/rpc/v1"
]
},
"subnets": {
"Nq_6aQol": {
"creator": "Aj0I_t",
"XRge9_": {
"creator": "4rENv3UF",
"validators": {
"ccXUc3": "7172262545587084591"
"4rENv3UF": "8736963158625135281"
},
"balances": {
"Aj0I_t": "9162460209480324624",
"ccXUc3": "5066607307630419796"
"6zLbz2": "1339038485993120736",
"JExQ": "9346083914812007261",
"JYWv_Qsa": "1"
},
"nodes": {
"66ACmYnr": {
"yLBi": {
"mode": {
"type": "Validator",
"validator": "ccXUc3"
"validator": "4rENv3UF"
},
"ethapi": true,
"ethapi": false,
"seed_nodes": [],
"parent_node": "https://ypa.api.calibration.node.glif.io/rpc/v1"
"parent_node": "https://4c1xblz.api.calibration.node.glif.io/rpc/v1"
}
},
"relayers": {
"_SfPAK_v": {
"submitter": "AJxB",
"follow_node": "66ACmYnr",
"submit_node": "https://ypa.api.calibration.node.glif.io/rpc/v1"
"8NnI": {
"submitter": "JYWv_Qsa",
"follow_node": "yLBi",
"submit_node": "https://4c1xblz.api.calibration.node.glif.io/rpc/v1"
},
"UIF_ZdMM": {
"submitter": "RrX",
"follow_node": "yLBi",
"submit_node": "https://0hjym.api.calibration.node.glif.io/rpc/v1"
},
"ulJUbp": {
"submitter": "RrX",
"follow_node": "yLBi",
"submit_node": "https://0hjym.api.calibration.node.glif.io/rpc/v1"
}
},
"subnets": {
"EhBMgOE": {
"creator": "AJxB",
"NeBA": {
"creator": "JExQ",
"validators": {
"Aj0I_t": "367423321636535243",
"TeBcA": "1",
"ccXUc3": "4622750394160732161"
"6zLbz2": "6777379231671441995"
},
"balances": {
"ccXUc3": "2093091713664174605"
"JExQ": "6281472171185470205",
"RrX": "8488966238082773925"
},
"nodes": {
"BiA": {
"sPxg66": {
"mode": {
"type": "Validator",
"validator": "ccXUc3"
"validator": "6zLbz2"
},
"ethapi": true,
"seed_nodes": [
"HekgqX"
],
"parent_node": "66ACmYnr"
},
"HekgqX": {
"mode": {
"type": "Validator",
"validator": "Aj0I_t"
},
"ethapi": false,
"seed_nodes": [],
"parent_node": "66ACmYnr"
},
"j_hfAR": {
"mode": {
"type": "Validator",
"validator": "TeBcA"
},
"ethapi": false,
"seed_nodes": [
"HekgqX"
],
"parent_node": "66ACmYnr"
"parent_node": "yLBi"
}
},
"relayers": {
"meX": {
"submitter": "AJxB",
"follow_node": "BiA",
"submit_node": "66ACmYnr"
"Mdky": {
"submitter": "6zLbz2",
"follow_node": "sPxg66",
"submit_node": "yLBi"
},
"kUi_": {
"submitter": "6zLbz2",
"follow_node": "sPxg66",
"submit_node": "yLBi"
},
"pny": {
"submitter": "JExQ",
"follow_node": "sPxg66",
"submit_node": "yLBi"
}
},
"subnets": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Manifest { accounts: {ResourceId("AJxB"): Account, ResourceId("Aj0I_t"): Account, ResourceId("TeBcA"): Account, ResourceId("ccXUc3"): Account}, rootnet: External { deployment: New { deployer: ResourceId("Aj0I_t") }, urls: [Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("e4gapevf.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "e4gapevf.api.calibration.node.glif.io", port: 443 }, Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("ypa.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "ypa.api.calibration.node.glif.io", port: 443 }, Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("m4662lst.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "m4662lst.api.calibration.node.glif.io", port: 443 }] }, subnets: {ResourceId("Nq_6aQol"): Subnet { creator: ResourceId("Aj0I_t"), validators: {ResourceId("ccXUc3"): Collateral(TokenAmount(7.172262545587084591))}, balances: {ResourceId("Aj0I_t"): Balance(TokenAmount(9.162460209480324624)), ResourceId("ccXUc3"): Balance(TokenAmount(5.066607307630419796))}, nodes: {ResourceId("66ACmYnr"): Node { mode: Validator { validator: ResourceId("ccXUc3") }, ethapi: true, seed_nodes: [], parent_node: Some(External(Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("ypa.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "ypa.api.calibration.node.glif.io", port: 443 })) }}, relayers: {ResourceId("_SfPAK_v"): Relayer { submitter: ResourceId("AJxB"), follow_node: ResourceId("66ACmYnr"), submit_node: External(Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("ypa.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "ypa.api.calibration.node.glif.io", port: 443 }) }}, subnets: {ResourceId("EhBMgOE"): Subnet { creator: ResourceId("AJxB"), validators: {ResourceId("Aj0I_t"): Collateral(TokenAmount(0.367423321636535243)), ResourceId("TeBcA"): Collateral(TokenAmount(0.000000000000000001)), ResourceId("ccXUc3"): Collateral(TokenAmount(4.622750394160732161))}, balances: {ResourceId("ccXUc3"): Balance(TokenAmount(2.093091713664174605))}, nodes: {ResourceId("BiA"): Node { mode: Validator { validator: ResourceId("ccXUc3") }, ethapi: true, seed_nodes: [ResourceId("HekgqX")], parent_node: Some(Internal(ResourceId("66ACmYnr"))) }, ResourceId("HekgqX"): Node { mode: Validator { validator: ResourceId("Aj0I_t") }, ethapi: false, seed_nodes: [], parent_node: Some(Internal(ResourceId("66ACmYnr"))) }, ResourceId("j_hfAR"): Node { mode: Validator { validator: ResourceId("TeBcA") }, ethapi: false, seed_nodes: [ResourceId("HekgqX")], parent_node: Some(Internal(ResourceId("66ACmYnr"))) }}, relayers: {ResourceId("meX"): Relayer { submitter: ResourceId("AJxB"), follow_node: ResourceId("BiA"), submit_node: Internal(ResourceId("66ACmYnr")) }}, subnets: {} }} }} }
Manifest { accounts: {'4rENv3UF': Account, '6zLbz2': Account, 'JExQ': Account, 'JYWv_Qsa': Account, 'RrX': Account}, rootnet: External { deployment: New { deployer: 'JExQ' }, urls: [Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("0hjym.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "0hjym.api.calibration.node.glif.io", port: 443 }, Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("4c1xblz.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "4c1xblz.api.calibration.node.glif.io", port: 443 }] }, subnets: {'XRge9_': Subnet { creator: '4rENv3UF', validators: {'4rENv3UF': Collateral(TokenAmount(8.736963158625135281))}, balances: {'6zLbz2': Balance(TokenAmount(1.339038485993120736)), 'JExQ': Balance(TokenAmount(9.346083914812007261)), 'JYWv_Qsa': Balance(TokenAmount(0.000000000000000001))}, nodes: {'yLBi': Node { mode: Validator { validator: '4rENv3UF' }, ethapi: false, seed_nodes: [], parent_node: Some(External(Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("4c1xblz.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "4c1xblz.api.calibration.node.glif.io", port: 443 })) }}, relayers: {'8NnI': Relayer { submitter: 'JYWv_Qsa', follow_node: 'yLBi', submit_node: External(Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("4c1xblz.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "4c1xblz.api.calibration.node.glif.io", port: 443 }) }, 'UIF_ZdMM': Relayer { submitter: 'RrX', follow_node: 'yLBi', submit_node: External(Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("0hjym.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "0hjym.api.calibration.node.glif.io", port: 443 }) }, 'ulJUbp': Relayer { submitter: 'RrX', follow_node: 'yLBi', submit_node: External(Url { inner: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("0hjym.api.calibration.node.glif.io")), port: None, path: "/rpc/v1", query: None, fragment: None }, scheme: Https, host: "0hjym.api.calibration.node.glif.io", port: 443 }) }}, subnets: {'NeBA': Subnet { creator: 'JExQ', validators: {'6zLbz2': Collateral(TokenAmount(6.777379231671441995))}, balances: {'JExQ': Balance(TokenAmount(6.281472171185470205)), 'RrX': Balance(TokenAmount(8.488966238082773925))}, nodes: {'sPxg66': Node { mode: Validator { validator: '6zLbz2' }, ethapi: true, seed_nodes: [], parent_node: Some(Internal('yLBi')) }}, relayers: {'Mdky': Relayer { submitter: '6zLbz2', follow_node: 'sPxg66', submit_node: Internal('yLBi') }, 'kUi_': Relayer { submitter: '6zLbz2', follow_node: 'sPxg66', submit_node: Internal('yLBi') }, 'pny': Relayer { submitter: 'JExQ', follow_node: 'sPxg66', submit_node: Internal('yLBi') }}, subnets: {} }} }} }
Loading

0 comments on commit 7d608b0

Please sign in to comment.