Skip to content

Commit 8375701

Browse files
committed
remove async from functions in wasm tests
1 parent 64d84c2 commit 8375701

8 files changed

Lines changed: 28 additions & 28 deletions

File tree

wasm-wrappers/js-bindings-test/tests/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { test_signed_transaction_intent } from "./test_signed_transaction_intent
2727
import { test_transaction_and_witness_encoding } from "./test_transaction_and_witness_encoding.js";
2828

2929
/** @public */
30-
export async function run_all_tests() {
30+
export function run_all_tests() {
3131
run_one_test(test_address_generation);
3232
run_one_test(test_encode_other_inputs);
3333
run_one_test(test_encode_other_outputs);

wasm-wrappers/js-bindings-test/tests/test_address_generation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ import {
4141
// but most tests don't care.
4242
export const ADDRESS = "tmt1q9dn5m4svn8sds3fcy09kpxrefnu75xekgr5wa3n";
4343

44-
export async function test_address_generation() {
44+
export function test_address_generation() {
4545
run_one_test(predefined_address_test);
4646
run_one_test(general_test);
4747
}
4848

49-
export async function predefined_address_test() {
49+
export function predefined_address_test() {
5050
const account_private_key = make_default_account_privkey(
5151
MNEMONIC,
5252
Network.Testnet
@@ -67,7 +67,7 @@ export async function predefined_address_test() {
6767
}
6868
}
6969

70-
export async function general_test() {
70+
export function general_test() {
7171
const bad_priv_key = TEXT_ENCODER.encode("bad");
7272

7373
try {

wasm-wrappers/js-bindings-test/tests/test_encode_other_inputs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ export const INPUTS = [
5454
// OutpointSourceId used in INPUTS.
5555
export const TX_OUTPOINT = new Uint8Array(33).fill(0)
5656

57-
export async function test_encode_other_inputs() {
57+
export function test_encode_other_inputs() {
5858
run_one_test(predefined_inputs_test);
5959
run_one_test(general_test);
6060
}
6161

62-
async function predefined_inputs_test() {
62+
function predefined_inputs_test() {
6363
const tx_input = encode_input_for_utxo(TX_OUTPOINT, 1);
6464
const deleg_id =
6565
"mdelg1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqut3aj8";
@@ -73,7 +73,7 @@ async function predefined_inputs_test() {
7373
assert_eq_arrays(inputs, INPUTS);
7474
}
7575

76-
export async function general_test() {
76+
export function general_test() {
7777
try {
7878
encode_input_for_utxo(TEXT_ENCODER.encode("asd"), 1);
7979
throw new Error("Invalid outpoint encoding worked somehow!");

wasm-wrappers/js-bindings-test/tests/test_encode_other_outputs.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const OUTPUT_CREATE_STAKE_POOL = [
6767
// Some tx outputs - LockThenTransfer and CreateStakePool
6868
export const OUTPUTS = [...OUTPUT_LOCK_THEN_TRANSFER, ...OUTPUT_CREATE_STAKE_POOL];
6969

70-
export async function test_encode_other_outputs() {
70+
export function test_encode_other_outputs() {
7171
run_one_test(create_stake_pool_test);
7272
run_one_test(stake_pool_data_test);
7373
run_one_test(coin_burn_test);
@@ -79,7 +79,7 @@ export async function test_encode_other_outputs() {
7979
run_one_test(issue_nft_test);
8080
}
8181

82-
async function create_stake_pool_test() {
82+
function create_stake_pool_test() {
8383
const vrf_public_key =
8484
"tvrfpk1qpk0t6np4gyl084fv328h6ahjvwcsaktrzfrs0xeqtrzpp0l7p28knrnn57";
8585

@@ -134,7 +134,7 @@ async function create_stake_pool_test() {
134134
assert_eq_arrays(outputs, OUTPUTS);
135135
}
136136

137-
async function stake_pool_data_test() {
137+
function stake_pool_data_test() {
138138
const vrf_public_key =
139139
"tvrfpk1qpk0t6np4gyl084fv328h6ahjvwcsaktrzfrs0xeqtrzpp0l7p28knrnn57";
140140

@@ -158,7 +158,7 @@ async function stake_pool_data_test() {
158158
}
159159
}
160160

161-
async function coin_burn_test() {
161+
function coin_burn_test() {
162162
try {
163163
encode_output_coin_burn(Amount.from_atoms("invalid amount"));
164164
throw new Error("Invalid value for amount worked somehow!");
@@ -170,7 +170,7 @@ async function coin_burn_test() {
170170
}
171171
}
172172

173-
async function token_burn_test() {
173+
function token_burn_test() {
174174
try {
175175
encode_output_token_burn(
176176
Amount.from_atoms("invalid amount"),
@@ -212,7 +212,7 @@ async function token_burn_test() {
212212
assert_eq_arrays(token_burn, expected_token_burn);
213213
}
214214

215-
async function lock_then_transfer_test() {
215+
function lock_then_transfer_test() {
216216
try {
217217
const invalid_lock = TEXT_ENCODER.encode("invalid lock");
218218
encode_output_lock_then_transfer(
@@ -230,7 +230,7 @@ async function lock_then_transfer_test() {
230230
}
231231
}
232232

233-
async function token_lock_then_transfer_test() {
233+
function token_lock_then_transfer_test() {
234234
try {
235235
const invalid_lock = TEXT_ENCODER.encode("invalid lock");
236236
encode_output_token_lock_then_transfer(
@@ -284,7 +284,7 @@ async function token_lock_then_transfer_test() {
284284
assert_eq_arrays(token_lock_transfer_out, expected_token_lock_transfer_out);
285285
}
286286

287-
async function token_transfer_test() {
287+
function token_transfer_test() {
288288
try {
289289
const invalid_address = "invalid address";
290290
encode_output_token_transfer(
@@ -337,7 +337,7 @@ async function token_transfer_test() {
337337
assert_eq_arrays(token_transfer_out, expected_token_transfer_out);
338338
}
339339

340-
async function issue_fungible_token_test() {
340+
function issue_fungible_token_test() {
341341
let encoded_fungible_token = encode_output_issue_fungible_token(
342342
ADDRESS,
343343
"XXX",
@@ -361,7 +361,7 @@ async function issue_fungible_token_test() {
361361
assert_eq_arrays(encoded_fungible_token, expected_fungible_token);
362362
}
363363

364-
async function issue_nft_test() {
364+
function issue_nft_test() {
365365
const account_pubkey = make_default_account_privkey(
366366
MNEMONIC,
367367
Network.Testnet

wasm-wrappers/js-bindings-test/tests/test_htlc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import {
5050
OUTPUTS,
5151
} from "./test_encode_other_outputs.js";
5252

53-
export async function test_htlc() {
53+
export function test_htlc() {
5454
const account_pubkey = make_default_account_privkey(
5555
MNEMONIC,
5656
Network.Testnet

wasm-wrappers/js-bindings-test/tests/test_misc.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
INPUTS,
4646
} from "./test_encode_other_inputs.js";
4747

48-
export async function test_misc() {
48+
export function test_misc() {
4949
run_one_test(test_verify_signature_for_spending);
5050
run_one_test(test_public_key_from_bad_private_key);
5151
run_one_test(test_make_default_account_privkey_from_bad_mnemonic);
@@ -56,7 +56,7 @@ export async function test_misc() {
5656
run_one_test(test_get_transaction_id);
5757
}
5858

59-
async function test_verify_signature_for_spending() {
59+
function test_verify_signature_for_spending() {
6060
const prv_key = get_predefined_prv_key();
6161
const pub_key = get_predefined_pub_key();
6262
const message = TEXT_ENCODER.encode("Hello, world!");
@@ -78,7 +78,7 @@ async function test_verify_signature_for_spending() {
7878
}
7979
}
8080

81-
async function test_public_key_from_bad_private_key() {
81+
function test_public_key_from_bad_private_key() {
8282
// Attempt to use a bad private key to get a public key (test returned Result<> object, which will become a string error)
8383
const bad_priv_key = TEXT_ENCODER.encode("bad");
8484
try {
@@ -94,7 +94,7 @@ async function test_public_key_from_bad_private_key() {
9494
}
9595
}
9696

97-
async function test_make_default_account_privkey_from_bad_mnemonic() {
97+
function test_make_default_account_privkey_from_bad_mnemonic() {
9898
try {
9999
const invalid_mnemonic = "asd asd";
100100
make_default_account_privkey(invalid_mnemonic, Network.Mainnet);
@@ -107,7 +107,7 @@ async function test_make_default_account_privkey_from_bad_mnemonic() {
107107
}
108108
}
109109

110-
async function test_sign_challenge() {
110+
function test_sign_challenge() {
111111
const prv_key = get_predefined_prv_key();
112112
const pub_key = get_predefined_pub_key();
113113
const message = TEXT_ENCODER.encode("Hello, world!");
@@ -132,7 +132,7 @@ async function test_sign_challenge() {
132132
}
133133
}
134134

135-
async function test_staking_pool_spend_maturity_block_count() {
135+
function test_staking_pool_spend_maturity_block_count() {
136136
const lock_for_blocks = staking_pool_spend_maturity_block_count(
137137
BigInt(1000),
138138
Network.Mainnet
@@ -143,7 +143,7 @@ async function test_staking_pool_spend_maturity_block_count() {
143143
}
144144
}
145145

146-
async function test_get_token_id() {
146+
function test_get_token_id() {
147147
try {
148148
get_token_id(new Uint8Array(), BigInt(1), Network.Testnet);
149149
throw "Token Id generated without a UTXO input somehow!";
@@ -168,7 +168,7 @@ async function test_get_token_id() {
168168
}
169169
}
170170

171-
async function test_effective_pool_balance() {
171+
function test_effective_pool_balance() {
172172
{
173173
const eff_bal = effective_pool_balance(
174174
Network.Mainnet,

wasm-wrappers/js-bindings-test/tests/test_orders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
ADDRESS
3838
} from "./test_address_generation.js";
3939

40-
export async function test_orders() {
40+
export function test_orders() {
4141
const order_output = encode_create_order_output(
4242
Amount.from_atoms("40000"),
4343
undefined,

wasm-wrappers/js-bindings-test/tests/test_transaction_and_witness_encoding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import {
4646
OUTPUT_LOCK_THEN_TRANSFER,
4747
} from "./test_encode_other_outputs.js";
4848

49-
export async function test_transaction_and_witness_encoding() {
49+
export function test_transaction_and_witness_encoding() {
5050
const account_pubkey = make_default_account_privkey(
5151
MNEMONIC,
5252
Network.Testnet

0 commit comments

Comments
 (0)