Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose subxt onclineclient / rpc #125

Merged
merged 13 commits into from
Oct 24, 2023
8 changes: 4 additions & 4 deletions crates/configuration/src/global_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"global_settings.bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
}
Expand All @@ -250,7 +250,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"global_settings.bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
assert_eq!(
Expand All @@ -268,7 +268,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"global_settings.local_ip: invalid IP address syntax"
);
}
Expand All @@ -284,7 +284,7 @@ mod tests {

assert_eq!(errors.len(), 3);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"global_settings.bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
assert_eq!(
Expand Down
10 changes: 5 additions & 5 deletions crates/configuration/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.default_image: 'invalid.image' doesn't match regex '^([ip]|[hostname]/)?[tag_name]:[tag_version]?$'"
);
assert_eq!(
Expand Down Expand Up @@ -622,7 +622,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[1000].collators['collator1'].command: 'invalid command' shouldn't contains whitespace"
);
assert_eq!(
Expand Down Expand Up @@ -679,7 +679,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[1000].collators['collator1'].command: 'invalid command' shouldn't contains whitespace"
);
assert_eq!(
Expand Down Expand Up @@ -724,7 +724,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"global_settings.local_ip: invalid IP address syntax"
);
assert_eq!(
Expand Down Expand Up @@ -766,7 +766,7 @@ mod tests {

assert_eq!(errors.len(), 3);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.nodes['node'].command: 'invalid command' shouldn't contains whitespace"
);
assert_eq!(
Expand Down
20 changes: 10 additions & 10 deletions crates/configuration/src/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[1000].chain: 'invalid chain' shouldn't contains whitespace"
);
}
Expand All @@ -853,7 +853,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[1000].default_command: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -875,7 +875,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"parachain[1000].default_image: 'invalid image' doesn't match regex '^([ip]|[hostname]/)?[tag_name]:[tag_version]?$'"
);
}
Expand All @@ -902,7 +902,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"parachain[1000].default_resources.request_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -925,7 +925,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[2000].genesis_wasm_generator: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -948,7 +948,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[1000].genesis_state_generator: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -971,7 +971,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[2000].bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
assert_eq!(
Expand All @@ -995,7 +995,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[1000].collators['collator'].command: 'invalid command' shouldn't contains whitespace"
);
}
Expand Down Expand Up @@ -1024,7 +1024,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[2000].collators['collator2'].command: 'invalid command' shouldn't contains whitespace"
);
}
Expand Down Expand Up @@ -1060,7 +1060,7 @@ mod tests {

assert_eq!(errors.len(), 5);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"parachain[2000].bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
assert_eq!(
Expand Down
14 changes: 7 additions & 7 deletions crates/configuration/src/relaychain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.chain: 'invalid chain' shouldn't contains whitespace"
);
}
Expand All @@ -531,7 +531,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.default_command: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -551,7 +551,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"relaychain.default_image: 'invalid image' doesn't match regex '^([ip]|[hostname]/)?[tag_name]:[tag_version]?$'"
);
}
Expand All @@ -576,7 +576,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"relaychain.default_resources.request_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -595,7 +595,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.nodes['node'].command: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -620,7 +620,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.nodes['node2'].command: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -646,7 +646,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"relaychain.default_resources.limit_cpu: 'invalid' doesn't match regex '^\\d+(.\\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
assert_eq!(
Expand Down
24 changes: 12 additions & 12 deletions crates/configuration/src/shared/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"command: 'invalid command' shouldn't contains whitespace"
);
}
Expand All @@ -734,7 +734,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"image: 'myinvalid.image' doesn't match regex '^([ip]|[hostname]/)?[tag_name]:[tag_version]?$'"
);
}
Expand All @@ -752,7 +752,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
}
Expand All @@ -770,7 +770,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"bootnodes_addresses[0]: '/ip4//tcp/45421' failed to parse: invalid IPv4 address syntax"
);
assert_eq!(
Expand All @@ -792,7 +792,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"resources.limit_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -814,7 +814,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"resources.limit_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
assert_eq!(
Expand Down Expand Up @@ -842,7 +842,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 4);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"command: 'invalid command' shouldn't contains whitespace"
);
assert_eq!(
Expand Down Expand Up @@ -875,7 +875,7 @@ mod tests {
assert_eq!(node_name, "mynode");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"name: 'mynode' is already used across config"
);
}
Expand All @@ -897,7 +897,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"ws_port: '30333' is already used across config"
);
}
Expand All @@ -919,7 +919,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"rpc_port: '4444' is already used across config"
);
}
Expand All @@ -941,7 +941,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"prometheus_port: '9089' is already used across config"
);
}
Expand All @@ -963,7 +963,7 @@ mod tests {
assert_eq!(node_name, "node");
assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
"p2p_port: '45093' is already used across config"
);
}
Expand Down
10 changes: 5 additions & 5 deletions crates/configuration/src/shared/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"request_memory: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -436,7 +436,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"request_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -449,7 +449,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"limit_memory: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -462,7 +462,7 @@ mod tests {

assert_eq!(errors.len(), 1);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"limit_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
}
Expand All @@ -478,7 +478,7 @@ mod tests {

assert_eq!(errors.len(), 2);
assert_eq!(
errors.get(0).unwrap().to_string(),
errors.first().unwrap().to_string(),
r"limit_cpu: 'invalid' doesn't match regex '^\d+(.\d+)?(m|K|M|G|T|P|E|Ki|Mi|Gi|Ti|Pi|Ei)?$'"
);
assert_eq!(
Expand Down
2 changes: 2 additions & 0 deletions crates/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ provider = { path = "../provider" }
# to review the exports for neeeded types
support = { path = "../support" }
tokio = { workspace = true }
futures = { workspace = true }
subxt = { workspace = true }
Loading