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

ToPrivateSend does not work with keyring #110

Open
ferrell-code opened this issue Mar 22, 2023 · 0 comments
Open

ToPrivateSend does not work with keyring #110

ferrell-code opened this issue Mar 22, 2023 · 0 comments
Labels
A-compatibility Area: Issues and PRs related to Compatibility C-bug Category: Issues documenting a bug

Comments

@ferrell-code
Copy link
Contributor

ferrell-code commented Mar 22, 2023

Below snippet will fail. Keyring does not work when passed as Signer. This was tested in node environment

 // Create a keyring instance
 const keyring = new Keyring({ type: "sr25519" });
 const alice = keyring.addFromUri("//Alice");

 const dolphinId = new BN(1);
 const thousandDol = new BN("1000000000000000000000");
 const toPrivateTx = await privateWallet.toPrivateSend(
    dolphinId,
    thousandDol,
    alice,
    alice.address
  );

However this script does work:

 // Create a keyring instance
 const keyring = new Keyring({ type: "sr25519" });
 const alice = keyring.addFromUri("//Alice");

 const dolphinId = new BN(1);
 const thousandDol = new BN("1000000000000000000000");
 const toPrivateTx = await privateWallet.toPrivateBuild(
    dolphinId,
    thousandDol,
    alice,
    alice.address
  );
 
 await toPrivateTx?.txs[0].signAndSend(alice, {});
@ferrell-code ferrell-code added C-bug Category: Issues documenting a bug A-compatibility Area: Issues and PRs related to Compatibility labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: Issues and PRs related to Compatibility C-bug Category: Issues documenting a bug
Projects
None yet
Development

No branches or pull requests

1 participant