-
Notifications
You must be signed in to change notification settings - Fork 245
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
Add try_spawn
function for Anvil and Geth bindings
#226
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a great start, we can now simplify the existing spawn functions by calling try_spawn.expect
crates/node-bindings/src/anvil.rs
Outdated
/// Spawning the anvil process failed. | ||
#[error("couldnt start anvil")] | ||
Spawn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should also include the wrapped io error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed at: bcdf7f8
crates/node-bindings/src/anvil.rs
Outdated
@@ -313,6 +346,107 @@ impl Anvil { | |||
chain_id: self.chain_id.or(chain_id), | |||
} | |||
} | |||
|
|||
/// Consumes the builder and spawns `anvil`. If spawning fails, returns an error. | |||
#[track_caller] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[track_caller] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed at: 263d850
@mattsse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the delay,
error variants look fine,
last thing left to do is to change the fn spawn
to
fn spawn(&self) -> Instance {
self.try_spawn().unwrap()
}
Added the above change in 037a15f |
Motivation
Closes: #136
Solution
PR Checklist