Skip to content
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

Account.fromKeyStore returns a wrong secret key #679

Open
thomas-senechal opened this issue Sep 19, 2024 · 0 comments
Open

Account.fromKeyStore returns a wrong secret key #679

thomas-senechal opened this issue Sep 19, 2024 · 0 comments

Comments

@thomas-senechal
Copy link
Member

When using a yaml keystore from Massa Wallet, the secret key returned by Account.fromKeyStore is wrong which cause an issue when attempting to sign.

But if the keystore is generated from Massa Web3, no issue when reimporting it, so the issue might come from Massa Wallet. This require more researches such as testing with other keystore files generated from Massa Wallet and other wallets

Here is a code snippet for the import:

import { parse as yamlParse } from 'yaml'
import { readFileSync } from 'fs'
import { AccountKeyStore, Account } from '@massalabs/massa-web3'

async function importFromYamlKeyStore(
  filepath: string,
  password: string
): Promise<Account> {
  const fileContent = readFileSync(filepath, 'utf8')
  const parsedData = yamlParse(fileContent) as AccountKeyStore

  return await Account.fromKeyStore(parsedData, password)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant