const btcswap = require('../src/btcswap.js'),
  assert = require('assert');

var btcSwap;

before(function() {
  init();
});

describe('lookupTicket', function() {
  it('simple', function(done) {
    btcSwap.lookupTicket(2, function(result) {
      assert.equal(result.id, 2);
      assert.equal(result.price, 0.0017);
      // TODO result.amount
      assert.equal(result.address, 'mvBWJFv8Uc84YEyZKBm8HZQ7qrvmBiH7zR');
      assert.equal(result.expiry, 1);
      assert.equal(result.claimer, '');
      assert.equal(result.txhash, '');
      done();
    });
  });
});

function init() {
  console.log('init');

  const host = 'localhost:8545';
  const address = '0xc214fd7067d32ffd79cfa7b425317f7194fc5546';  // Olympic with PoW disabled
  const btcTestnet = true;
  btcSwap = new btcswap({
    host: host,
    address: address,
    btcTestnet: btcTestnet
  });
}

@@ -241,33 +241,39 @@
  %7B%0A      assert.
-e
+strictE
 qual(result.id, 
@@ -281,33 +281,39 @@
 );%0A      assert.
-e
+strictE
 qual(result.pric
@@ -319,14 +319,16 @@
 ce, 
+'
 0.0017
+'
 );%0A 
@@ -336,29 +336,64 @@
     
-// TODO result.amount
+assert.strictEqual(result.amount, '170000000000000000');
 %0A   
@@ -394,33 +394,39 @@
 );%0A      assert.
-e
+strictE
 qual(result.addr
@@ -474,33 +474,39 @@
 );%0A      assert.
-e
+strictE
 qual(result.expi
@@ -518,33 +518,39 @@
 );%0A      assert.
-e
+strictE
 qual(result.clai
@@ -572,17 +572,23 @@
  assert.
-e
+strictE
 qual(res

use strictEqual, especially to catch implicit conversion of bitcoin.Address to a string