|
1 |
| -// ignore_for_file: avoid_print |
2 |
| - |
3 |
| -import 'package:example/test/address/ada_shelly/ada_shelly.dart'; |
4 |
| -import 'package:example/test/address/algo/algo.dart'; |
5 |
| -import 'package:example/test/address/aptos/aptos.dart'; |
6 |
| -import 'package:example/test/address/atom/atom.dart'; |
7 |
| -import 'package:example/test/address/avax/avax.dart'; |
8 |
| -import 'package:example/test/address/bch_p2pkh/bch_p2pkh.dart'; |
9 |
| -import 'package:example/test/address/bch_p2sh/bch_p2sh.dart'; |
10 |
| -import 'package:example/test/address/egld/egld.dart'; |
11 |
| -import 'package:example/test/address/eos/eos.dart'; |
12 |
| -import 'package:example/test/address/ergo/ergo.dart'; |
13 |
| -import 'package:example/test/address/eth/eth.dart'; |
14 |
| -import 'package:example/test/address/fil/fil.dart'; |
15 |
| -import 'package:example/test/address/icx/icx.dart'; |
16 |
| -import 'package:example/test/address/inj/inj.dart'; |
17 |
| -import 'package:example/test/address/nano/nano.dart'; |
18 |
| -import 'package:example/test/address/neo/neo.dart'; |
19 |
| -import 'package:example/test/address/okex/okex.dart'; |
20 |
| -import 'package:example/test/address/one/one.dart'; |
21 |
| -import 'package:example/test/address/p2pkh/p2pkh.dart'; |
22 |
| -import 'package:example/test/address/p2sh/p2sh.dart'; |
23 |
| -import 'package:example/test/address/p2tr/p2tr.dart'; |
24 |
| -import 'package:example/test/address/p2wpkh/p2wpkh.dart'; |
25 |
| -import 'package:example/test/address/sol/sol.dart'; |
26 |
| -import 'package:example/test/address/substrate/substrate.dart'; |
27 |
| -import 'package:example/test/address/trx/trx.dart'; |
28 |
| -import 'package:example/test/address/xlm/xml.dart'; |
29 |
| -import 'package:example/test/address/xmr/xmr.dart'; |
30 |
| -import 'package:example/test/address/xrp/xrp.dart'; |
31 |
| -import 'package:example/test/address/xtz/xtz.dart'; |
32 |
| -import 'package:example/test/address/zil/zil.dart'; |
33 |
| -import 'package:example/test/algorand/mnemonic.dart'; |
34 |
| -import 'package:example/test/base58/base58.dart'; |
35 |
| -import 'package:example/test/base58/base58_xmr.dart'; |
36 |
| -import 'package:example/test/bech32/bch_bech32.dart'; |
37 |
| -import 'package:example/test/bech32/bech32.dart'; |
38 |
| -import 'package:example/test/bech32/segwit_bech32.dart'; |
39 |
| -import 'package:example/test/bip/bip32/ed25519/ed25519.dart'; |
40 |
| -import 'package:example/test/bip/bip32/ed25519_blake2b/ed25519_blake2b.dart'; |
41 |
| -import 'package:example/test/bip/bip32/ed25519_khalow/ed25519_khalow.dart'; |
42 |
| -import 'package:example/test/bip/bip32/nist256p1/nist256p1.dart'; |
43 |
| -import 'package:example/test/bip/bip32/secp256k1/secp256k1.dart'; |
44 |
| -import 'package:example/test/bip/bip38/bip38_addr.dart'; |
45 |
| -import 'package:example/test/bip/bip38/bip38_ec.dart'; |
46 |
| -import 'package:example/test/bip/bip38/bip38_no_ec.dart'; |
47 |
| -import 'package:example/test/bip/bip39/bip39.dart'; |
48 |
| -import 'package:example/test/bip/bip44/bip44.dart'; |
49 |
| -import 'package:example/test/bip/bip49/bip49.dart'; |
50 |
| -import 'package:example/test/bip/bip84/bip84.dart'; |
51 |
| -import 'package:example/test/bip/bip86/bip86.dart'; |
52 |
| -import 'package:example/test/cardano/bip32/icarus.dart'; |
53 |
| -import 'package:example/test/cardano/bip32/legacy.dart'; |
54 |
| -import 'package:example/test/cardano/byron/byron_lagacy.dart'; |
55 |
| -import 'package:example/test/cardano/cip1852/cip1852.dart'; |
56 |
| -import 'package:example/test/cardano/mnemonic/mnemonic.dart'; |
57 |
| -import 'package:example/test/cardano/shelly/shelly.dart'; |
58 |
| -import 'package:example/test/cbor.dart'; |
59 |
| -import 'package:example/test/crypto/aes/aes_ctr.dart'; |
60 |
| -import 'package:example/test/crypto/blake2b/blake2b.dart'; |
61 |
| -import 'package:example/test/crypto/chacha20_poly1305/chacha20_poly1305.dart'; |
62 |
| -import 'package:example/test/crypto/crc32/crc32.dart'; |
63 |
| -import 'package:example/test/crypto/hmac/hmac.dart'; |
64 |
| -import 'package:example/test/crypto/keccack/keccack.dart'; |
65 |
| -import 'package:example/test/crypto/md4/md4.dart'; |
66 |
| -import 'package:example/test/crypto/md5/md5.dart'; |
67 |
| -import 'package:example/test/crypto/pbkdf2/pbkdf2.dart'; |
68 |
| -import 'package:example/test/crypto/ripemd/ripemd.dart'; |
69 |
| -import 'package:example/test/crypto/scrypt/scrypt.dart'; |
70 |
| -import 'package:example/test/crypto/sha1/sha1.dart'; |
71 |
| -import 'package:example/test/crypto/sha256/sha256.dart'; |
72 |
| -import 'package:example/test/crypto/sha3/sha3.dart'; |
73 |
| -import 'package:example/test/crypto/sha512/sha512.dart'; |
74 |
| -import 'package:example/test/crypto/sha512_256/sha512_256.dart'; |
75 |
| -import 'package:example/test/crypto/shake/shake.dart'; |
76 |
| -import 'package:example/test/crypto/x_modem_crc/x_modem_crc.dart'; |
77 |
| -import 'package:example/test/ecdsa/ed.dart'; |
78 |
| -import 'package:example/test/ecdsa/projective.dart'; |
79 |
| -import 'package:example/test/elctrum/mnemonic/mnemonic.dart'; |
80 |
| -import 'package:example/test/elctrum/v1/v1.dart'; |
81 |
| -import 'package:example/test/elctrum/v2/v2.dart'; |
82 |
| -import 'package:example/test/monero/mnemonic/monero_mnemonic.dart'; |
83 |
| -import 'package:example/test/schnorrkel/derive.dart'; |
84 |
| -import 'package:example/test/schnorrkel/schnorrkel_key.dart'; |
85 |
| -import 'package:example/test/schnorrkel/sign.dart'; |
86 |
| -import 'package:example/test/schnorrkel/vrf.dart'; |
87 |
| -import 'package:example/test/secure_storage.dart'; |
88 |
| -import 'package:example/test/signer/ethereum.dart'; |
89 |
| -import 'package:example/test/signer/tron.dart'; |
90 |
| -import 'package:example/test/signer/xrp.dart'; |
91 |
| -import 'package:example/test/ss58/ss58.dart'; |
92 |
| -import 'package:example/test/substrate/scale.dart'; |
93 |
| -import 'package:example/test/substrate/substrate.dart'; |
94 |
| -import 'package:example/test/ton_mnemonic/ton_mnemonic.dart'; |
95 |
| -import 'package:example/test/uuid.dart'; |
96 |
| -import 'package:example/test/wif/wif.dart'; |
97 |
| -import 'package:flutter/material.dart'; |
98 |
| - |
99 |
| -import 'test/address/near/near.dart'; |
100 |
| - |
101 |
| -/// for test in different ENV |
102 |
| -/// The package is created in Pure Dart and this test contains thousands of tests, |
103 |
| -/// it may take a long time (5-10) minutes. |
104 |
| -void main() { |
105 |
| - runApp(MaterialApp( |
106 |
| - home: Scaffold( |
107 |
| - body: Column( |
108 |
| - children: [ |
109 |
| - FilledButton( |
110 |
| - onPressed: () { |
111 |
| - _testAll(); |
112 |
| - }, |
113 |
| - child: const Text("start test")) |
114 |
| - ], |
115 |
| - ), |
116 |
| - ), |
117 |
| - )); |
118 |
| - // _testAll(); |
119 |
| -} |
120 |
| - |
121 |
| -typedef TestMethod = void Function(); |
122 |
| - |
123 |
| -/// its very slow in web debugging |
124 |
| -/// if you want to test this method on the web should remove the condition |
125 |
| -void _web() { |
126 |
| - // if (kIsWeb) return; |
127 |
| - _test("bip38 No Ecdsa", bip38NoEcdsaTest); |
128 |
| - _test("bip38 ECDSA", bip38ECDSATest); |
129 |
| - _test("scrypt", testScrypt); |
130 |
| - _test("pbkdf2", pbkdf2Test); |
131 |
| - _test("secure storage", testSecureStorage); |
132 |
| -} |
133 |
| - |
134 |
| -void _test(String name, TestMethod process) { |
135 |
| - try { |
136 |
| - process(); |
137 |
| - print("test pass $name"); |
138 |
| - } catch (e) { |
139 |
| - print("test error $name $e"); |
140 |
| - throw Exception(); |
141 |
| - } |
142 |
| -} |
143 |
| - |
144 |
| -void _testAll() async { |
145 |
| - final DateTime start = DateTime.now(); |
146 |
| - _encodeDecodeAddrTest(); |
147 |
| - |
148 |
| - _test("UUID", testUUID); |
149 |
| - _test("bech32", bech32Test); |
150 |
| - _test("wif", wifTest); |
151 |
| - _test("substrate scale", substrateScaleTest); |
152 |
| - _test("ss58", ss58Test); |
153 |
| - _test("bip38 ", bip38Test); |
154 |
| - _test("segwit Bech32 ", segwitBech32Test); |
155 |
| - _test("bch bech32", bchBech32Test); |
156 |
| - _test("base58 xmr", testBase58XMR); |
157 |
| - _test("base58", testBase58); |
158 |
| - _test("bip49", bip49Test); |
159 |
| - _test("bip44", bip44Test); |
160 |
| - _test("algorandMnemonic and derive address", algorandMnemonicAndAddressTest); |
161 |
| - _test("substrate derive", substrateDeriveTest); |
162 |
| - _test("monero mnemonic", moneroMnemonucTest); |
163 |
| - _test("ton mnemonic", tonMnemonic); |
164 |
| - _test("sign ethereum", signEthereum); |
165 |
| - _test("sign tron", signTron); |
166 |
| - _test("sign xrp", signXrp); |
167 |
| - |
168 |
| - // _test("monero", moneroTest); |
169 |
| - _test("electrum v2", electrumV2Test); |
170 |
| - _test("electrum v1", electrumV1Test); |
171 |
| - _test("electrum mnemonic", electrumMnemonicTest); |
172 |
| - _test("cardano shelly", cardanoShellyTest); |
173 |
| - _test("cardano mnemonic", cardanoMnemonicTest); |
174 |
| - _test("cardano cip1852", cip1852Test); |
175 |
| - _test("byron legacy", byronLegacyTest); |
176 |
| - _test("cardano icarus", cardanoIcarusTest); |
177 |
| - _test("cardano legacy", cardanoLegacyTest); |
178 |
| - _test("bip86", bip86Test); |
179 |
| - _test("bip84", bip84Test); |
180 |
| - _test("bip39", testBip39); |
181 |
| - _test("secp256k1", secpTest); |
182 |
| - _test("nist", nistTest); |
183 |
| - _test("ed25519-blake2b", edBlake2bTest); |
184 |
| - _test("ed25519-khalow", edKhalowTest); |
185 |
| - _test("ed25519", edTest); |
186 |
| - _test("schnorr", schnoorTestDerive); |
187 |
| - _test("vrf sigh", vrfSignTest); |
188 |
| - _test("schnorrkel keys", schnoorKeyTest); |
189 |
| - _test("schnorrkel-sign", testSchnoor); |
190 |
| - _test("ecdsa", testECDSA); |
191 |
| - _test("eddsa", testEDDSa); |
192 |
| - _test("sha1", testSha1); |
193 |
| - _test("ripemd", testRipemd); |
194 |
| - _test("md5", md5Test); |
195 |
| - _test("md4", md4Test); |
196 |
| - _test("keccack", testKecc); |
197 |
| - _test("hmac", testHmac); |
198 |
| - _test("crc", crcTest); |
199 |
| - _test("chacha-poly1305", chachaTest); |
200 |
| - _test("aes", testAes); |
201 |
| - _test("blake2b", blake2bTest); |
202 |
| - _test("sha256", testSha256); |
203 |
| - _test("sha512", testSha512); |
204 |
| - _test("sha3", testSha3); |
205 |
| - _test("sha512/256", testSha512256); |
206 |
| - _test("modemCrc", testModemCrc); |
207 |
| - _test("shake digest", testShakeDigest); |
208 |
| - _test("cbor test", cborTest); |
209 |
| - |
210 |
| - _web(); |
211 |
| - final DateTime end = DateTime.now(); |
212 |
| - print("end: ${end.difference(start).inMilliseconds}"); |
213 |
| -} |
214 |
| - |
215 |
| -void _encodeDecodeAddrTest() { |
216 |
| - _test("zil Address", zilAddressTest); |
217 |
| - _test("xtz Address", xtzAddressTest); |
218 |
| - _test("xrp Address", xrpAddressTest); |
219 |
| - _test("xmr Address", xmrAddressTest); |
220 |
| - _test("xlm Address", xlmAddressTest); |
221 |
| - _test("trx Address", trxAddressTest); |
222 |
| - _test("substrate Address", substrateAddressTest); |
223 |
| - _test("sol Address", solAddressTest); |
224 |
| - _test("p2wpkh Address", p2wpkhAddressTest); |
225 |
| - _test("p2tr Address", p2trAddressTest); |
226 |
| - _test("p2sh Address", p2shAddressTest); |
227 |
| - _test("p2pkh Address", p2pkhAddressTest); |
228 |
| - _test("one Address", oneAddressTest); |
229 |
| - _test("okex Address", okexAddressTest); |
230 |
| - _test("neo Address", neoAddressTest); |
231 |
| - _test("near Address", nearAddressTest); |
232 |
| - _test("nano Address", nanoAddressTest); |
233 |
| - _test("injAddressTest", injAddressTest); |
234 |
| - _test("icx Address", icxAddressTest); |
235 |
| - _test("fil Address", filAddressTest); |
236 |
| - _test("ethereum Address", ethereumAddressTest); |
237 |
| - _test("ergo Address", ergoAddressTest); |
238 |
| - _test("eos Address", eosAddrTest); |
239 |
| - _test("egld Address", egldAddrTest); |
240 |
| - _test("bchP2sh Address", bchP2shAddressTest); |
241 |
| - _test("bchP2pkh Address", bchP2pkhTest); |
242 |
| - _test("avax Address", avaxAddrTest); |
243 |
| - _test("atom Address", atomAddressTest); |
244 |
| - _test("aptos Address", aptosAddressTest); |
245 |
| - _test("algo Address", algoAddressTest); |
246 |
| - _test("ada Shelly Address", adaShellyAddrTest); |
247 |
| -} |
| 1 | +void main() {} |
0 commit comments