Skip to content

Commit 7722915

Browse files
committed
nits
Signed-off-by: Sam Batschelet <[email protected]>
1 parent 478f099 commit 7722915

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

scripts/tests.e2e.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
# build spacesvm-rs binary
4+
# build spacesvm binary
55
# ./scripts/build.release.sh
66
#
77
# download from github, keep network running
8-
# VM_PLUGIN_PATH=$(pwd)/target/release/spacesvm-rs ./scripts/tests.e2e.sh
8+
# VM_PLUGIN_PATH=$(pwd)/target/release/spacesvm ./scripts/tests.e2e.sh
99
#
1010
# download from github, shut down network
11-
# NETWORK_RUNNER_ENABLE_SHUTDOWN=1 VM_PLUGIN_PATH=$(pwd)/target/release/spacesvm-rs ./scripts/tests.e2e.sh
11+
# NETWORK_RUNNER_ENABLE_SHUTDOWN=1 VM_PLUGIN_PATH=$(pwd)/target/release/spacesvm ./scripts/tests.e2e.sh
1212
#
1313
# use custom avalanchego binary
14-
# VM_PLUGIN_PATH=$(pwd)/target/release/timestampvm ./scripts/tests.e2e.sh ~/go/src/github.com/ava-labs/avalanchego/build/avalanchego
14+
# VM_PLUGIN_PATH=$(pwd)/target/release/spacesvm ./scripts/tests.e2e.sh ~/go/src/github.com/ava-labs/avalanchego/build/avalanchego
1515
#
1616
if ! [[ "$0" =~ scripts/tests.e2e.sh ]]; then
1717
echo "must be run from repository root"

spaces-cli/src/bin/spaces-cli/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ struct Cli {
4343
#[command(subcommand)]
4444
command: Command,
4545
}
46-
47-
fn main() -> Result<(), Box<dyn error::Error>> {
46+
#[tokio::main]
47+
async fn main() -> Result<(), Box<dyn error::Error>> {
4848
let cli = Cli::parse();
4949

5050
let private_key = get_or_create_pk(&cli.private_key_file)?;

spacesvm/src/api/client.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Client<HttpConnector> {
8181
/// Returns a recoverable signature from bytes.
8282
pub fn sign_digest(&self, dh: &[u8]) -> Result<Sig> {
8383
if let Some(pk) = &self.private_key {
84-
pk.sign_digest(dh)?;
84+
return pk.sign_digest(dh);
8585
}
8686
Err(Error::new(ErrorKind::Other, "private key not set"))
8787
}
@@ -125,15 +125,14 @@ impl Client<HttpConnector> {
125125
space: space.as_bytes().to_vec(),
126126
key: key.as_bytes().to_vec(),
127127
})?;
128-
let (_id, json_request) = self.raw_request("issueTx", &Params::Array(vec![arg_value]));
128+
let (_id, json_request) = self.raw_request("resolve", &Params::Array(vec![arg_value]));
129129
let resp = self.post_de::<ResolveResponse>(&json_request).await?;
130130

131131
Ok(resp)
132132
}
133133

134134
/// Returns a deserialized response from client request.
135135
pub async fn post_de<T: de::DeserializeOwned>(&self, json: &str) -> Result<T> {
136-
println!("json: {}", json);
137136
let req = Request::builder()
138137
.method(Method::POST)
139138
.uri(self.endpoint.to_string())
@@ -221,8 +220,8 @@ pub fn get_or_create_pk(path: &str) -> Result<key::secp256k1::private_key::Key>
221220
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
222221
}
223222

224-
#[tokio::test]
225-
async fn test_raw_request() {
223+
#[test]
224+
fn test_raw_request() {
226225
let mut cli = Client::new(Uri::from_static("http://test.url"));
227226
let (id, _) = cli.raw_request("ping", &Params::None);
228227
assert_eq!(id, jsonrpc_core::Id::Num(0));

tests/e2e/src/tests/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async fn e2e() {
3333
assert!(exists);
3434
assert!(Path::new(&vm_plugin_path).exists());
3535

36-
let vm_id = subnet::vm_name_to_id("minikvvm").unwrap();
36+
let vm_id = subnet::vm_name_to_id("spacesvm").unwrap();
3737

3838
let (mut avalanchego_exec_path, _) = crate::get_avalanchego_path();
3939
let plugins_dir = if !avalanchego_exec_path.is_empty() {
@@ -50,7 +50,7 @@ async fn e2e() {
5050
// keep this in sync with "proto" crate
5151
// ref. https://github.com/ava-labs/avalanchego/blob/v1.9.2/version/constants.go#L15-L17
5252
let (exec_path, plugins_dir) =
53-
avalanche_installer::avalanchego::download(None, None, Some("v1.9.2".to_string()))
53+
avalanche_installer::avalanchego::download(None, None, Some("v1.9.3".to_string()))
5454
.await
5555
.unwrap();
5656
avalanchego_exec_path = exec_path;

0 commit comments

Comments
 (0)