Skip to content

Commit

Permalink
🐛 Fix restoring private key
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Jul 13, 2023
1 parent 85e936d commit be622ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Runtime/codebase/InGameWallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ protected override Task<Account> _CreateAccount(string secret = null, string pas
}
if(account == null) return Task.FromResult<Account>(null);

MainThreadDispatcher.Instance().Enqueue(SaveEncryptedAccount(password, mnem, account.PublicKey));
MainThreadDispatcher.Instance().Enqueue(SaveEncryptedAccount(password,
mnem != null ? mnem.ToString() : secret, account.PublicKey));

Mnemonic = mnem;
return Task.FromResult(account);
}


private IEnumerator SaveEncryptedAccount(string password, Mnemonic mnemonic, PublicKey account)
private IEnumerator SaveEncryptedAccount(string password, string secret, PublicKey account)
{
yield return new WaitForSeconds(.1f);
password ??= "";
var secret = mnemonic.ToString();

var keystoreService = new KeyStorePbkdf2Service();
var stringByteArray = Encoding.UTF8.GetBytes(secret);
Expand Down

0 comments on commit be622ac

Please sign in to comment.