Skip to content

Commit

Permalink
Use environment in accept_terms_and_conditions() (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-21 authored May 16, 2023
1 parent b821162 commit c7bd679
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ impl LightningNode {
}
}

pub fn accept_terms_and_conditions(seed: Vec<u8>, graphql_url: String) -> Result<()> {
pub fn accept_terms_and_conditions(environment: EnvironmentCode, seed: Vec<u8>) -> Result<()> {
let environment = Environment::load(environment);
let seed = sanitize_input::strong_type_seed(&seed)?;
let auth = build_auth(&seed, graphql_url)?;
let auth = build_auth(&seed, environment.backend_url)?;
auth.accept_terms_and_conditions()
.map_runtime_error_to(RuntimeErrorCode::AuthServiceUnvailable)
}
Expand Down
2 changes: 1 addition & 1 deletion src/lipalightninglib.udl
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace lipalightninglib {
sequence<string> words_by_prefix(string prefix);

[Throws=LnError]
void accept_terms_and_conditions(sequence<u8> seed, string graphql_url);
void accept_terms_and_conditions(EnvironmentCode environment, sequence<u8> seed);

// Performs a recovery procedure by fetching necessary data from remote storage.
// It should and can only be called on a fresh install of the app, if the user wants to recover a previously created wallet.
Expand Down

0 comments on commit c7bd679

Please sign in to comment.