diff --git a/Runtime/codebase/InGameWallet.cs b/Runtime/codebase/InGameWallet.cs index 76765df..af41dc3 100644 --- a/Runtime/codebase/InGameWallet.cs +++ b/Runtime/codebase/InGameWallet.cs @@ -73,18 +73,18 @@ protected override Task _CreateAccount(string secret = null, string pas } if(account == null) return Task.FromResult(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);