Skip to content

Commit

Permalink
Use account in the key file instead of decoding it from the mnemonic. F…
Browse files Browse the repository at this point in the history
…ixes #751
  • Loading branch information
romac committed Apr 8, 2021
1 parent 68e276e commit c21c9a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion relayer/src/keyring/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,17 @@ impl KeyRing {
let key_file: KeyFile =
serde_json::from_str(key_file_content).map_err(|e| Kind::InvalidKey.context(e))?;

let key = self
let mut key = self
.key_from_mnemonic(&key_file.mnemonic)
.map_err(|e| Kind::InvalidMnemonic.context(e))?;

// Use the account in the key file, otherwise the one decoded from
// the mnemonic will have the configured account prefix which may
// not match the one in the key file.
//
// TODO: Implement proper deserialization of the the KeyFile into a KeyEntry.
key.account = key_file.address;

Ok(key)
}

Expand Down

0 comments on commit c21c9a9

Please sign in to comment.