Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Merge #2155 #2168
Browse files Browse the repository at this point in the history
2155: Follow-up of #2107 r=mergify[bot] a=D4nte

Also integrates changes from comit-network/comit-js-sdk#145.

2168: Upgrade node to version 12 r=mergify[bot] a=bonomat

@thomaseizinger found an issue describing incompatibility of the node version we are using on circleCI and jest: jestjs/jest#9453.

The tests are running locally. So let's upgrade circleCI as well. 

Co-authored-by: Franck Royer <franck@coblox.tech>
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
  • Loading branch information
3 people authored Mar 5, 2020
3 parents e00f696 + 6eabd00 + 18fa42d commit 457fdb6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ commands:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
echo "deb https://deb.nodesource.com/node_10.x/ trusty main" | sudo tee /etc/apt/sources.list.d/node_10.list
echo "deb https://deb.nodesource.com/node_12.x/ trusty main" | sudo tee /etc/apt/sources.list.d/node_12.list
sudo apt-get update
sudo apt-get install -y nodejs=10.* yarn
sudo apt-get install -y nodejs=12.* yarn
install_rust:
steps:
- run:
Expand Down
9 changes: 5 additions & 4 deletions api_tests/lib/actors/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ export class Actor {

this.swap = await comitClient.sendSwap(payload);
to.swap = new Swap(to.cnd, this.swap.self, {
bitcoinWallet: to.wallets.bitcoin.inner,
ethereumWallet: to.wallets.ethereum.inner,
bitcoin: to.wallets.bitcoin.inner,
ethereum: to.wallets.ethereum.inner,
});
this.logger.debug("Created new swap at %s", this.swap.self);

Expand Down Expand Up @@ -905,14 +905,15 @@ export class Actor {
public async lnCreateHoldInvoice(
sats: string,
secretHash: string,
expiry: number
expiry: number,
cltvExpiry: number
): Promise<void> {
this.logger.debug("LN: Create Hold Invoice", sats, secretHash, expiry);
const resp = await this.wallets.lightning.inner.addHoldInvoice(
sats,
secretHash,
expiry,
"test hold invoice"
cltvExpiry
);
this.logger.debug("LN: Create Hold Response:", resp);
}
Expand Down
3 changes: 1 addition & 2 deletions api_tests/lib/wallets/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BigNumber, Lnd } from "comit-sdk";
import { Asset } from "comit-sdk";
import { Asset, BigNumber, Lnd } from "comit-sdk";
import { HarnessGlobal, sleep } from "../utils";
import { BitcoinWallet } from "./bitcoin";
import { EthereumWallet } from "./ethereum";
Expand Down
2 changes: 2 additions & 0 deletions api_tests/lib/wallets/lightning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class LightningWallet implements Wallet {
lndp2pSocket
);

logger.debug("lnd getinfo:", await inner.lnd.lnrpc.getInfo());

return new LightningWallet(inner, logger, bitcoinWallet);
}

Expand Down
4 changes: 2 additions & 2 deletions api_tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"fix": "tslint --project . --fix && prettier --write '**/*.{ts,js,json,yml}'"
},
"engines": {
"node": "^10.14"
"node": "^12"
},
"author": "CoBloX Team",
"license": "ISC",
Expand Down Expand Up @@ -45,7 +45,7 @@
"chai-json-schema": "^1.5.0",
"chai-string": "^1.5.0",
"chai-subset": "^1.6.0",
"comit-sdk": "^0.13.0",
"comit-sdk": "^0.14.0",
"commander": "^4.1.1",
"ethers": "^4.0.45",
"get-port": "^5.1.1",
Expand Down
9 changes: 7 additions & 2 deletions api_tests/sanity/hold_lnd_payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ setTimeout(function() {
);

const satAmount = "10000";
const finalCltvDelta = 40; // This MUST be 40 to match Bob's invoice. Further investigation needed.
const finalCltvDelta = 10;

const { secret, secretHash } = bob.lnCreateSha256Secret();
await bob.lnCreateHoldInvoice(satAmount, secretHash, 3600);
await bob.lnCreateHoldInvoice(
satAmount,
secretHash,
3600,
finalCltvDelta
);
const paymentPromise = alice.lnSendPayment(
bob,
satAmount,
Expand Down
8 changes: 4 additions & 4 deletions api_tests/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1242,10 +1242,10 @@ combined-stream@1.0.8, combined-stream@^1.0.6, combined-stream@^1.0.8, combined-
dependencies:
delayed-stream "~1.0.0"

comit-sdk@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/comit-sdk/-/comit-sdk-0.13.0.tgz#bc0d53b6bd49d475aa78fa8d4f237e60cc0807bd"
integrity sha512-bn64Jz9pFn3xvghqx0nLNgrl3IeZOdhzP0iECERXcJSqmtyAWTMYvxw6mHmGe34oRR7vXcQH49JF2QkNi/Cs6A==
comit-sdk@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/comit-sdk/-/comit-sdk-0.14.0.tgz#8183e92ab6543b32a19883372bee61ece3faf741"
integrity sha512-cyGw0yvDIQJUntuV5h4+XckInZ6iu6NqS8dnw3QIiQjXz7AskFfF5WotTeRt7LnqYtbZWz2fnRTEChvf2/R3Bg==
dependencies:
"@radar/lnrpc" "^0.9.0-beta"
axios "^0.19.0"
Expand Down

0 comments on commit 457fdb6

Please sign in to comment.