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

bitcore-lib-doge Unhandled Rejection (Error): Assertion failed #3314

Closed
dxteam2024 opened this issue Dec 18, 2021 · 2 comments
Closed

bitcore-lib-doge Unhandled Rejection (Error): Assertion failed #3314

dxteam2024 opened this issue Dec 18, 2021 · 2 comments

Comments

@dxteam2024
Copy link

dxteam2024 commented Dec 18, 2021

try to use the doge package in browser:

try to sign a transaction,
var fromAddress = 'DSw2NHz2YfTeFogjeGJvZVVZkjkxSSX3zx';
var toAddress = 'DE1wEbm9D6JqEhqGtyD52BkHQmQ5N18J84';
var changeAddress = 'DAPkqFzgrXVsUU7WkSf1GYMmFzEGvuK4SK';
var privateKey = 'dd7bdefb163b31eb706ec43589c24cd27fc7878216836468bf216845c7c4aa1c';
var private1 = 'ba9bb7f48969e94301025313c298916b2913fb7eecefe98b9128ef4d87e40ea40';
var private2 = '6403e70451390134f2bddbe5ecb33c5b264af292fcbf2cdd97deaac7e1e8f7ba0';

// console.log(new doge.PrivateKey(privateKey, "mainnet").toAddress().toString())

var simpleUtxoWith10DOGE = {
  address: fromAddress,
  txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458',
  outputIndex: 0,
  script: doge.Script.buildPublicKeyHashOut(fromAddress).toString(),
  satoshis: 10e8
};
var transaction = new doge.Transaction()
  .from(simpleUtxoWith10DOGE)
  .to(toAddress, 50000)
  // .change(changeAddress)
  .sign(privateKey);
console.log(transaction.toString())

i got this error:
doge.js:1 Uncaught (in promise) Error: Assertion failed
at n (:8000/js/doge.js:1)
at s.toBuffer (:8000/js/doge.js:1)
at e.f.toBuffer.f.toDER (:8000/js/doge.js:1)
at b.addSignature (:8000/js/doge.js:1)
at x.applySignature (:8000/js/doge.js:1)
at :8000/js/doge.js:1
at Wt (:8000/js/doge.js:1)
at Function.Go (:8000/js/doge.js:1)
at x.sign (:8000/js/doge.js:1)
at _callee2$ (:8000/p__transaction.js:501)
at tryCatch (:8000/mf-dep_vendors-node_modules_umijs_preset-built-in_node_modules_regenerator-runtime_runtime_js.08045b18.async.js:53)
at Generator.invoke [as _invoke] (:8000/mf-dep_vendors-node_modules_umijs_preset-built-in_node_modules_regenerator-runtime_runtime_js.08045b18.async.js:282)
at Generator.prototype. [as next] (:8000/mf-dep_vendors-node_modules_umijs_preset-built-in_node_modules_regenerator-runtime_runtime_js.08045b18.async.js:105)
at asyncGeneratorStep (:8000/mf-dep_src_umi_cache_mfsu_mf-va_D__workspaces_walletApps_demo_node_modules__umijs_babel-preset-umi_n-b07fb7.3974ce3a.async.js:16)
at _next (:8000/mf-dep_src_umi_cache_mfsu_mf-va_D__workspaces_walletApps_demo_node_modules__umijs_babel-preset-umi_n-b07fb7.3974ce3a.async.js:38)

can any one work this out? thanks

@dxteam2024
Copy link
Author

dxteam2024 commented Dec 18, 2021

all method in the browser works fine except transaction sign method

@vikowl
Copy link

vikowl commented Mar 1, 2022

@aliray have you found a problem?

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

3 participants
@dxteam2024 @vikowl and others