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

setupRefund() failing #19

Open
meinharrd opened this issue Mar 23, 2015 · 7 comments
Open

setupRefund() failing #19

meinharrd opened this issue Mar 23, 2015 · 7 comments

Comments

@meinharrd
Copy link

hi there,

when following the docs and examples to set up a channel, i get this error:

bitcore-channel.js:140 Uncaught TypeError: Cannot read property 'script' of undefined

this happens because outputs[] is empty. the insight api call however does return utxo transactions. so i assume that something in Consumer.processFunding() is not parsing them properly.

my code:

var consumer = new Consumer({
  network: 'testnet',
  fundingKey: fundingKey,
  refundKey: refundKey,
  commitmentKey: commitmentKey,
  providerPublicKey: providerPublicKey,
});

var insight = new Insight(bitcore.Networks.testnet);
insight.getUnspentUtxos(consumer.fundingAddress, function(err, utxos) {
  consumer.processFunding(utxos);
  consumer.setupRefund();
});

any clues?

@flotob
Copy link

flotob commented Mar 24, 2015

some more info related to this bug here: https://labs.bitpay.com/t/payment-channels-consumer-setuprefund-failing/416

@maraoz
Copy link
Contributor

maraoz commented Mar 25, 2015

Thanks for reporting, will take a look now

@meinharrd
Copy link
Author

any chance we'll have more insight before the weekend? ;)

@maraoz
Copy link
Contributor

maraoz commented Mar 31, 2015

The problem is bigger than we expected. We'll review this in a few weeks, as it's not a priority for us now. Sorry! Feel free to provide a fixing PR if you find a solution on your own :)

@flotob
Copy link

flotob commented Apr 1, 2015

Thanks @maraoz ! It seems you do have a clue as to where the problem may be located, at least roughly. Could you provide a guesstimate? :-)

Also, would we encounter the same problem when reimplementing the microtx-channel functionality simply with general bitcore API? Basically following the publicly available specs for such channels but using bitcore's simplified API for building transactions etc.?

Cheers

@illuzen
Copy link

illuzen commented Jun 3, 2015

I wrote a fix for this, but am confused how to use gulp. Will make a pull request once this happens.

Will somebody explain how to run "gulp lint" on bitcore-channel?

I have gulp installed globally via sudo npm install -g gulp.
Running gulp in bitcore-channel asks for bitcore-build, so I do sudo npm install bitcore-build.
Running gulp then produces "Task 'lint' is not in your gulpfile"

I think I'm missing details on how bitcore-build and bitcore-channel are supposed to be related. Maybe the gulp files are shared? sorry for being such a n00b

@illuzen
Copy link

illuzen commented Jun 5, 2015

I believe the latest merge takes care of this.

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

4 participants