-
-
Notifications
You must be signed in to change notification settings - Fork 30
Add support for loading existing accounts from key #120
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
Conversation
|
This seems surprising. @cpu have you seen this before? I guess it might have something to do with running two environments in the same test?
|
e4580df to
6ce8f87
Compare
The issue here is that you need to use This diff fixes it for me locally:diff --git a/tests/pebble.rs b/tests/pebble.rs
index 91f66ec..3216b8f 100644
--- a/tests/pebble.rs
+++ b/tests/pebble.rs
@@ -381,7 +381,7 @@ async fn account_from_key() -> Result<(), Box<dyn StdError>> {
let env = Environment::new(EnvironmentConfig::default()).await?;
let server_url = format!("https://{}/dir", &env.config.pebble.listen_address);
- let (account1, credentials) = Account::builder()?
+ let (account1, credentials) = Account::builder_with_http(Box::new(env.client.clone()))
.create(
&NewAccount {
contact: &[],
@@ -403,7 +403,7 @@ async fn account_from_key() -> Result<(), Box<dyn StdError>> {
let key_der = BASE64_URL_SAFE_NO_PAD.decode(json_key.key_pkcs8)?;
let key = Key::from_pkcs8_der(PrivatePkcs8KeyDer::from(key_der.clone()))?;
- let (account2, credentials2) = Account::builder()?
+ let (account2, credentials2) = Account::builder_with_http(Box::new(env.client.clone()))
.from_key((key, PrivateKeyDer::try_from(key_der.clone())?), server_url)
.await?;
@@ -419,7 +419,7 @@ async fn account_from_key() -> Result<(), Box<dyn StdError>> {
let server_url = format!("https://{}/dir", &env.config.pebble.listen_address);
let key = Key::from_pkcs8_der(PrivatePkcs8KeyDer::from(key_der.clone()))?;
- let result = Account::builder()?
+ let result = Account::builder_with_http(Box::new(env.client.clone()))
.from_key((key, PrivateKeyDer::try_from(key_der)?), server_url)
.await;
|
Co-authored-by: Akos Vandra-Meyer <[email protected]>
Obsoletes #94, fixes #93.
cc @axos88