projects
/
ldk-java
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8fc1235
)
Update typescript test to latest API
author
Matt Corallo
<git@bluematt.me>
Tue, 4 Jan 2022 21:23:23 +0000
(21:23 +0000)
committer
Matt Corallo
<git@bluematt.me>
Wed, 5 Jan 2022 06:35:03 +0000
(06:35 +0000)
ts/test/index.html
patch
|
blob
|
history
diff --git
a/ts/test/index.html
b/ts/test/index.html
index 9358a47c0ce1062642c88880000b2afa89d1af9a..3e7c6694d19d2a1af903e56446ba73ec8f214fcd 100644
(file)
--- a/
ts/test/index.html
+++ b/
ts/test/index.html
@@
-43,7
+43,7
@@
console.log('integer passed from wasm:', argument);
};
imports.env["js_invoke_function"] = function(fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {
console.log('integer passed from wasm:', argument);
};
imports.env["js_invoke_function"] = function(fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {
- console.log('
integer passed from wasm:', argument
);
+ console.log('
function called from wasm:', fn
);
};
const stream = fetch('../../liblightningjs.wasm');
};
const stream = fetch('../../liblightningjs.wasm');
@@
-93,21
+93,21
@@
}
const result = wasm.TS_CResult_boolLightningErrorZ_ok(true);
}
const result = wasm.TS_CResult_boolLightningErrorZ_ok(true);
- console.assert(wasm.TS_
LDKCResult_boolLightningErrorZ_result
_ok(result));
+ console.assert(wasm.TS_
CResult_boolLightningErrorZ_is
_ok(result));
console.assert(wasm.TS_LDKCResult_boolLightningErrorZ_get_ok(result));
wasm.TS_CResult_boolLightningErrorZ_free(result);
console.assert(wasm.TS_CResult_boolLightningErrorZ_ok(false) == result); // malloc doesn't need to guarantee this, but currently does
console.assert(wasm.TS_LDKCResult_boolLightningErrorZ_get_ok(result));
wasm.TS_CResult_boolLightningErrorZ_free(result);
console.assert(wasm.TS_CResult_boolLightningErrorZ_ok(false) == result); // malloc doesn't need to guarantee this, but currently does
- console.assert(wasm.TS_
LDKCResult_boolLightningErrorZ_result
_ok(result));
+ console.assert(wasm.TS_
CResult_boolLightningErrorZ_is
_ok(result));
console.assert(!wasm.TS_LDKCResult_boolLightningErrorZ_get_ok(result));
wasm.TS_CResult_boolLightningErrorZ_free(result);
var pk_arr = [];
for (var i = 0; i < 33; i++) { pk_arr[i] = 42; }
const pk_bytes = encodeUint8Array(pk_arr);
console.assert(!wasm.TS_LDKCResult_boolLightningErrorZ_get_ok(result));
wasm.TS_CResult_boolLightningErrorZ_free(result);
var pk_arr = [];
for (var i = 0; i < 33; i++) { pk_arr[i] = 42; }
const pk_bytes = encodeUint8Array(pk_arr);
- const pk_res = wasm.TS_CResult_PublicKey
Secp
ErrorZ_ok(pk_bytes);
- console.assert(wasm.TS_
LDKCResult_PublicKeySecpErrorZ_result
_ok(pk_res));
- const pk_res_bytes = wasm.TS_LDKCResult_PublicKey
Secp
ErrorZ_get_ok(pk_res);
- wasm.TS_
LDKCResult_PublicKeySecp
ErrorZ_free(pk_res);
+ const pk_res = wasm.TS_CResult_PublicKeyErrorZ_ok(pk_bytes);
+ console.assert(wasm.TS_
CResult_PublicKeyErrorZ_is
_ok(pk_res));
+ const pk_res_bytes = wasm.TS_LDKCResult_PublicKeyErrorZ_get_ok(pk_res);
+ wasm.TS_
CResult_PublicKey
ErrorZ_free(pk_res);
console.log("pass");
})();
console.log("pass");
})();