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 Error,encryptedPriKey address password not match #217

Open
lishuo5263 opened this issue Feb 14, 2019 · 1 comment
Open

Account Error,encryptedPriKey address password not match #217

lishuo5263 opened this issue Feb 14, 2019 · 1 comment

Comments

@lishuo5263
Copy link

when I use ontio java sdk I want transfer ont to another account,I fllow document ,here is my code:

try {
Transaction tx = ontSdkClient.nativevm().ont()
.makeTransfer(from, to, amount.longValue(), from, 20000, 500);
com.github.ontio.account.Account acct = ontSdkClient.getWalletMgr()
.getAccount(from, walletPwd);
ontSdkClient.signTx(tx, new com.github.ontio.account.Account[][]{{acct}});
ontSdkClient.getConnect().sendRawTransaction(tx.toHexString());
txId = tx.hash().toHexString();
} catch (Exception e) {
e.printStackTrace();
}

But when code executed .getAccount(from, walletPwd); I has something wrong, here is my log:

com.github.ontio.sdk.exception.SDKException: {"Desc":"Other Error,{"Desc":"Account Error,encryptedPriKey address password not match.","Error":51015}","Error":59000}

And I change the pom jar version ,whatever jar version I has same error,please help!!!

@NashMiao
Copy link
Contributor

@lishuo5263 Hi, Maybe you need to open your local wallet file firstly. Something like this:

OntSdk wm = OntSdk.getInstance();
wm.openWalletFile("walletfile.json");

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

2 participants