REL: up build num; REF: scripts; TST

This commit is contained in:
Overtorment 2020-05-08 11:21:06 +01:00
parent ea2e4e747b
commit 5261daec5a
10 changed files with 58 additions and 9 deletions

View File

@ -140,7 +140,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "5.3.6"
versionName "5.3.7"
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'general'
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type

View File

@ -48,7 +48,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.3.6</string>
<string>5.3.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.3.6</string>
<string>5.3.7</string>
<key>CFBundleVersion</key>
<string>239</string>
<key>CLKComplicationPrincipalClass</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.3.6</string>
<string>5.3.7</string>
<key>CFBundleVersion</key>
<string>239</string>
<key>UISupportedInterfaceOrientations</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.3.6</string>
<string>5.3.7</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "bluewallet",
"version": "5.3.6",
"version": "5.3.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "bluewallet",
"version": "5.3.6",
"version": "5.3.7",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.6.2",

View File

@ -0,0 +1 @@
./node_modules/.bin/jest --testNamePattern='can pay invoice' tests/integration/lightning-custodian-wallet.test.js

View File

@ -149,7 +149,55 @@ describe('LightningCustodianWallet', () => {
assert.strictEqual(decodedLocally.cltv_expiry, decodedRemotely.cltv_expiry);
});
it('can pay invoice', async () => {
it('can pay invoice from opennode', async () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 200 * 1000;
if (!process.env.BLITZHUB) {
console.error('process.env.BLITZHUB not set, skipped');
return;
}
if (!process.env.OPENNODE) {
console.error('process.env.OPENNODE not set, skipped');
return;
}
const api = new Frisbee({
baseURI: 'https://api.opennode.co',
});
const res = await api.post('/v1/charges', {
headers: {
'Content-Type': 'application/json',
Authorization: process.env.OPENNODE,
},
body: '{"amount": "0.01", "currency": "USD"}',
});
if (!res.body.data || !res.body.data.lightning_invoice || !res.body.data.lightning_invoice.payreq) {
throw new Error('Opennode problem');
}
const invoice = res.body.data.lightning_invoice.payreq;
let l2 = new LightningCustodianWallet();
l2.setSecret(process.env.BLITZHUB);
await l2.authorize();
await l2.fetchTransactions();
let txLen = l2.transactions_raw.length;
let start = +new Date();
await l2.payInvoice(invoice);
let end = +new Date();
if ((end - start) / 1000 > 9) {
console.warn('payInvoice took', (end - start) / 1000, 'sec');
}
await l2.fetchTransactions();
assert.strictEqual(l2.transactions_raw.length, txLen + 1);
let lastTx = l2.transactions_raw[l2.transactions_raw.length - 1];
assert.strictEqual(typeof lastTx.payment_preimage, 'string', 'preimage is present and is a string');
assert.strictEqual(lastTx.payment_preimage.length, 64, 'preimage is present and is a string of 32 hex-encoded bytes');
// transactions became more after paying an invoice
});
it('can pay invoice (acinq)', async () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 200 * 1000;
if (!process.env.BLITZHUB) {
console.error('process.env.BLITZHUB not set, skipped');
@ -323,7 +371,7 @@ describe('LightningCustodianWallet', () => {
assert.strictEqual(invoices[1].amt, 666);
});
it('can pay free amount (tip) invoice', async function() {
it('can pay invoice with free amount (tippin.me)', async function() {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 200 * 1000;
if (!process.env.BLITZHUB) {
console.error('process.env.BLITZHUB not set, skipped');