Compare commits

..
302 Commits
Author SHA1 Message Date
Github Actions 2d07c0a6a3 [CI Skip] release/stable 1.3.1
skip-checks: true
2020-08-09 12:31:46 +00:00
Jaco Greeff 8b7c7e93af 1.3 (#98) 2020-08-09 14:27:39 +02:00
Github Actions 393d898dab [CI Skip] release/beta 1.3.0-beta.30
skip-checks: true
2020-08-08 06:54:58 +00:00
Jaco Greeff fcf6d439ef Bump deps (#97) 2020-08-08 08:50:31 +02:00
Github Actions 5ccb1b4982 [CI Skip] release/beta 1.3.0-beta.29
skip-checks: true
2020-08-06 12:05:34 +00:00
Jaco Greeff 7ee706a99f Bump berry (#96)
* Bump berry

* Rewrite
2020-08-06 14:00:58 +02:00
Github Actions da491efef6 [CI Skip] release/beta 1.3.0-beta.28
skip-checks: true
2020-08-05 10:35:37 +00:00
Jaco Greeff 2ff45e1ca6 De-dup & update Rust packages (#95)
* De-dup & update Rust packages

* Explicitly pass wasm-opt false (manual run)
2020-08-05 12:30:26 +02:00
Github Actions 6aac8e8771 [CI Skip] release/beta 1.3.0-beta.27
skip-checks: true
2020-08-03 16:21:37 +00:00
Jaco Greeff 6ebdfe9362 Bump deps (#94) 2020-08-03 18:16:01 +02:00
Github Actions de9bf473f1 [CI Skip] release/beta 1.3.0-beta.26
skip-checks: true
2020-08-03 13:31:27 +00:00
Jaco Greeff 735584aef9 Scrypt TS interface (#93) 2020-08-03 15:25:34 +02:00
Github Actions 7a33da9e53 [CI Skip] release/beta 1.3.0-beta.25
skip-checks: true
2020-08-03 12:52:58 +00:00
Jaco Greeff 0faca1b98e Add scrypt hashing (#92) 2020-08-03 14:47:17 +02:00
Github Actions ab867541d7 [CI Skip] release/beta 1.3.0-beta.24
skip-checks: true
2020-08-03 12:02:58 +00:00
Jaco Greeff f50d6af2bb Updates for latest wasm-pack formats (#91)
* Updates for latest wasm-pack formats

* Cleanup sed output
2020-08-03 13:57:34 +02:00
Github Actions 8c4bf9470a [CI Skip] release/beta 1.3.0-beta.23
skip-checks: true
2020-08-03 08:56:21 +00:00
Jaco Greeff e5875a73c3 Bumps (#90) 2020-08-03 10:51:08 +02:00
Github Actions e32e52a94c [CI Skip] release/beta 1.3.0-beta.22
skip-checks: true
2020-07-31 08:07:58 +00:00
Jaco Greeff 59673150ba Bump deps (#89) 2020-07-31 10:02:40 +02:00
Github Actions 9f84fc3250 [CI Skip] release/beta 1.3.0-beta.21
skip-checks: true
2020-07-17 11:43:46 +00:00
Jaco Greeff 678063e12a Cargo bumps (#86) 2020-07-17 13:38:05 +02:00
Github Actions 02324280e3 [CI Skip] release/beta 1.3.0-beta.20
skip-checks: true
2020-07-17 11:18:16 +00:00
Jaco Greeff 9bc97a4e1d Update ed25519-dalek (#85)
* Update ed25519-dalek

* Bump subtle
2020-07-17 13:12:21 +02:00
Github Actions 4cc1d4e515 [CI Skip] release/beta 1.3.0-beta.19
skip-checks: true
2020-07-17 06:40:47 +00:00
Jaco Greeff 8ae9bbd3b6 Bump deps (#84) 2020-07-17 08:35:00 +02:00
Github Actions 08c9e9e8ac [CI Skip] release/beta 1.3.0-beta.18
skip-checks: true
2020-07-02 05:14:32 +00:00
Jaco Greeff b3c32738e3 Bump deps (#83) 2020-07-02 07:08:58 +02:00
Github Actions 72ff8a13dc [CI Skip] release/beta 1.3.0-beta.17
skip-checks: true
2020-06-05 20:21:05 +00:00
Jaco Greeff 1d75701361 Bump deps (#81) 2020-06-05 22:14:56 +02:00
Github Actions 2fd1daf39a [CI Skip] release/beta 1.3.0-beta.16
skip-checks: true
2020-05-31 12:47:38 +00:00
Jaco Greeff ef6db82c52 Remove bip39ToSeed (#80)
* Cleanups, no mnemonic to seed (only minisecret)

* Remove bip39ToSeed
2020-05-31 14:42:13 +02:00
Github Actions 1e2caa35ce [CI Skip] 1.3.0-beta.15
skip-checks: true
2020-05-23 16:30:45 +00:00
Jaco Greeff 8c0aa030cf Bump deps (#79)
* Bump deps

* Rust bumps

* Rust bumps (again)

* Pin nightly

* Cleanup with new generation
2020-05-23 18:25:53 +02:00
Github Actions ff9fe99ca5 [CI Skip] 1.3.0-beta.14
skip-checks: true
2020-05-15 10:35:25 +00:00
Jaco Greeff e0feb7864d Bump deps (#78) 2020-05-15 12:30:58 +02:00
Jaco Greeff c8431fc3d1 Bump berry (#77)
* Bump berry

* .eslintrc.js into ignore
2020-05-11 11:54:35 +02:00
Github Actions 849285a35d [CI Skip] 1.3.0-beta.13
skip-checks: true
2020-04-30 06:24:28 +00:00
Jaco Greeff 5fe38fa47b Bump deps (#76)
* Bump deps

* linting
2020-04-30 08:19:36 +02:00
Github Actions 241bbe99c5 [CI Skip] 1.3.0-beta.12
skip-checks: true
2020-04-06 10:30:14 +00:00
Jaco Greeff 65d89a7b41 Use bundled node (#75) 2020-04-06 12:25:59 +02:00
Github Actions a0cbf8c531 [CI Skip] 1.3.0-beta.11
skip-checks: true
2020-04-05 07:59:24 +00:00
Jaco Greeff c50fe071cb Bump deps (#74) 2020-04-05 09:54:38 +02:00
Github Actions 526b79435e [CI Skip] 1.3.0-beta.10
skip-checks: true
2020-04-04 08:46:29 +00:00
Jaco Greeff b621b79bae Bump deps (#73) 2020-04-04 10:42:04 +02:00
Github Actions 37b04af274 [CI Skip] 1.3.0-beta.9
skip-checks: true
2020-04-02 06:07:16 +00:00
Jaco Greeff 84f0d27744 Rewrite yarn.lock (#72) 2020-04-02 08:02:17 +02:00
Github Actions ff2315bff8 [CI Skip] 1.3.0-beta.8
skip-checks: true
2020-03-21 09:12:23 +00:00
Jaco Greeff 6fa0e99141 Bump deps (#71) 2020-03-21 10:07:48 +01:00
Github Actions 7c9bbb05a6 [CI Skip] 1.3.0-beta.7
skip-checks: true
2020-03-16 14:35:50 +00:00
Jaco Greeff 3ef1b2073f Add yarn matrix (#70) 2020-03-16 15:31:06 +01:00
Github Actions b56924a5b3 [CI Skip] 1.3.0-beta.6
skip-checks: true
2020-03-16 13:37:50 +00:00
Jaco Greeff bf7feafaaa Remove actions matrix (#69) 2020-03-16 14:33:16 +01:00
Github Actions 184edb6e4e [CI Skip] 1.3.0-beta.5
skip-checks: true
2020-03-15 07:24:48 +00:00
Jaco Greeff d511310ba0 Remove non-working CI cache (#68) 2020-03-15 08:19:47 +01:00
Github Actions 7ad87c6ce2 [CI Skip] 1.3.0-beta.4
skip-checks: true
2020-03-14 16:46:54 +00:00
Jaco Greeff 01a5539c28 Bump berry (#67)
* Bump berry

* yarn
2020-03-14 17:41:41 +01:00
Github Actions dd107338e9 [CI Skip] 1.3.0-beta.3
skip-checks: true
2020-03-14 14:35:02 +00:00
Jaco Greeff 61ffef08e3 VSCode pnpify (#66) 2020-03-14 15:29:40 +01:00
Github Actions 76a436f22c [CI Skip] 1.3.0-beta.2
skip-checks: true
2020-03-14 08:33:56 +00:00
Jaco Greeff 86a66de726 Bump deps (#65) 2020-03-14 09:28:33 +01:00
Github Actions 7c4d2f7af5 [CI Skip] 1.3.0-beta.1
skip-checks: true
2020-03-04 12:32:34 +00:00
Jaco Greeff a20b14a8b7 Use yarn pnp (#64)
* Use yarn pnp

* Bump dev

* Bumps

* Attempt to fix build

* Move "override-require": "^1.1.1" dep

* Bump
2020-03-04 13:26:56 +01:00
Github Actions e5c31a0fe7 [CI Skip] 1.3.0-beta.0
skip-checks: true
2020-03-03 06:32:56 +00:00
Jaco Greeff 0fc0207bcb Remove preaudit_deprecated feature to schnorrkel (unused now) 2020-03-03 07:28:04 +01:00
Github Actions 645cf3dbf7 [CI Skip] 1.2.1
skip-checks: true
2020-02-29 12:50:25 +00:00
Jaco Greeff 0fd350f5d6 1.2 (#62) 2020-02-29 13:45:32 +01:00
Github Actions 5e85feae7b [CI Skip] 1.2.0-beta.7
skip-checks: true
2020-02-29 11:31:54 +00:00
Jaco Greeff 2a61459682 Remove yarn version plugin, bump dev (#61) 2020-02-29 12:27:28 +01:00
Github Actions 370d0de745 [CI Skip] 1.2.0-beta.6
skip-checks: true
2020-02-29 09:31:17 +00:00
Jaco Greeff 07dd07c9db yarn --immutable on CI (#60) 2020-02-29 10:26:21 +01:00
Github Actions e6b892df6f [CI Skip] 1.2.0-beta.5
skip-checks: true
2020-02-28 21:29:54 +00:00
Jaco Greeff e93e764a72 Merge branch 'master' of github.com:polkadot-js/wasm 2020-02-28 22:24:50 +01:00
Jaco Greeff 331111b895 opt-level z 2020-02-28 22:24:47 +01:00
Github Actions 31afd5143f [CI Skip] 1.2.0-beta.4
skip-checks: true
2020-02-28 21:23:55 +00:00
Jaco Greeff a0126f374e Add opt-level for (some) space savings (#59) 2020-02-28 22:19:11 +01:00
Github Actions f11be090e8 [CI Skip] 1.2.0-beta.3
skip-checks: true
2020-02-28 16:23:28 +00:00
Jaco Greeff f3dbf059b7 trigger 2020-02-28 17:16:32 +01:00
Jaco Greeff eba92df762 trigger 2019-04-28 19:32:10 +01:00
Jaco Greeff e4a717faa6 trigger 2019-05-05 19:32:10 +01:00
Github Actions 075ba8a365 [CI Skip] 1.2.0-beta.2
skip-checks: true
2020-02-28 12:05:13 +00:00
Jaco Greeff a9b2ac1240 Swap to yarn 2 (#58)
* Swap to yarn 2

* Use polkadot-dev-run-test for jest

* Try and fix JS tests via jest

* Try via @polkadot/dev
2020-02-28 12:58:57 +01:00
Github Actions d336b1f894 [CI Skip] 1.2.0-beta.1
skip-checks: true
2020-02-26 21:17:06 +00:00
Jaco Greeff c976f3ebf9 Use binaryen from GH releases (Linux) (#57)
* Use binaryen from GH releases (Linux)

* echo for downloading
2020-02-26 22:12:17 +01:00
Github Actions cdcfe2823d [CI Skip] 1.2.0-beta.0
skip-checks: true
2020-02-25 10:41:10 +00:00
Jaco Greeff 57030cb591 Unpin nightly (#56) 2020-02-25 11:29:10 +01:00
Github Actions 88ebaf650b [CI Skip] 1.1.1
skip-checks: true
2020-02-24 20:54:04 +00:00
Jaco Greeff 28bac70cfe 1.1 (#55) 2020-02-24 21:41:38 +01:00
Github Actions aaab1725b8 [CI Skip] 1.1.0-beta.0
skip-checks: true
2020-02-24 15:38:48 +00:00
Jaco Greeff 4c7a9609bd Drop sr25519 verify_simple_preaudit_deprecated (#54)
* Drop sr25519 verify_simple_preaudit_deprecated

* Add missing Signature import

* Update test-verctor, 0.8.5+ only signatures

* Trigger

* Pin Rust nightly

* Pin via run

* De-dup nightlies

* Update tests to use nightly-2020-02-17

* Update CHANGELOG

* Typo
2020-02-24 16:24:49 +01:00
Jaco Greeff e1c51d766f Add yarn cache (#53) 2020-02-17 15:18:15 +01:00
Github Actions c30a354b67 [CI Skip] 1.0.1
skip-checks: true
2020-02-15 09:54:43 +00:00
Jaco Greeff b2d0c437be 1.0 (#52) 2020-02-15 10:42:04 +01:00
Jaco Greeff 59c9bbec25 Bump dev (#51) 2020-02-14 10:20:57 +01:00
Github Actions 7be59495b9 [CI Skip] 0.20.1
skip-checks: true
2020-01-30 15:00:56 +00:00
Jaco Greeff 33c2413247 0.20 (#50) 2020-01-30 15:46:36 +01:00
Github Actions 2345285e3d [CI Skip] 0.20.0-beta.4
skip-checks: true
2020-01-29 09:10:07 +00:00
Jaco Greeff d1f188444c Bump deps (#49) 2020-01-29 09:55:13 +01:00
Github Actions a3cc64ed51 [CI Skip] 0.20.0-beta.3
skip-checks: true
2020-01-28 17:27:05 +00:00
Jaco Greeff 721ae96a7c Bump deps 2020-01-28 18:13:19 +01:00
Github Actions 70dfe47d79 [CI Skip] 0.20.0-beta.2
skip-checks: true
2020-01-25 09:49:38 +00:00
Jaco Greeff 2ad1132a48 Bump deps (#48) 2020-01-25 10:35:50 +01:00
Github Actions 9246bef8bb [CI Skip] 0.20.0-beta.1
skip-checks: true
2020-01-13 15:39:55 +00:00
Jaco Greeff 9f08e7832f Bump schnorrkel to 0.8 (#29)
* Bump schnorrkel to 0.8

* Remove unneeded return refactor (stick to issues at-hand)

* Mid-point step, use rev, verify signatures

* Update to 0.8.2

* Flatten for easier inspection

* 0.8.3 rev that passes the tests

* Updates for 0.8.3 memory allocation

* Test for Rust keypair imports

* Rust ed25519 compat

* 0.8.4

* sr25519 0.8.5, bump deps

* tiny-keccak config

* Update keccack hashing

* Update hashing
2020-01-13 16:26:04 +01:00
Github Actions c14d84749a [CI Skip] 0.15.0-beta.184
skip-checks: true
2020-01-06 12:57:04 +00:00
Jaco Greeff 1f4612bf32 Bump deps (#47) 2020-01-06 13:44:06 +01:00
Github Actions e724536d9c [CI Skip] 0.15.0-beta.183
skip-checks: true
2019-12-07 13:09:57 +00:00
Jaco Greeff 0d7ec76900 Bump deps (#46) 2019-12-07 13:58:59 +01:00
Github Actions 6dc6de5629 [CI Skip] 0.15.0-beta.182
skip-checks: true
2019-12-05 09:35:59 +00:00
Jaco Greeff bd42b2b9ee Bump deps (#45) 2019-12-05 10:25:20 +01:00
Jaco Greeff 8024f524b3 Bump deps (#44)
* Bump deps

* Add dummy skip step
2019-12-05 10:09:04 +01:00
Github Actions b10190e6cf [CI Skip] 0.15.0-beta.181 2019-11-06 21:26:54 +00:00
Jaco Greeff 2147464449 Bump deps (#43) 2019-11-06 22:15:31 +01:00
Github Actions e74c15b239 [CI Skip] 0.15.0-beta.180 2019-10-28 16:29:12 +00:00
Jaco Greeff 3112aa8acb Use GH_PAT is checkout action 2019-10-28 17:15:24 +01:00
Github Actions 2ad4e10a32 [CI Skip] 0.15.0-beta.179 2019-10-22 13:37:50 +00:00
Jaco Greeff db3f3d273d Excl. tsconfig build (#42) 2019-10-22 15:24:14 +02:00
Github Actions e4cc9ffbe9 [CI Skip] 0.15.0-beta.178 2019-10-22 09:47:07 +00:00
Jaco Greeff d74d9e8de4 Bump deps (#41) 2019-10-22 11:34:52 +02:00
Github Actions 0c946aa527 [CI Skip] 0.15.0-beta.177 2019-10-14 07:08:53 +00:00
Jaco Greeff ab61af29ab Don't run on CI Skip 2019-10-14 08:56:05 +02:00
Github Actions 576aeba620 [CI Skip] 0.15.0-beta.176 2019-10-13 20:05:18 +00:00
Github Actions 10f06d932a [CI Skip] 0.15.0-beta.175 2019-10-13 19:53:37 +00:00
Github Actions 5531f01815 [CI Skip] 0.15.0-beta.174 2019-10-13 19:41:20 +00:00
Github Actions 5a88a13454 [CI Skip] 0.15.0-beta.173 2019-10-13 19:29:56 +00:00
Github Actions 4c069d8e8d [CI Skip] 0.15.0-beta.172 2019-10-13 19:18:29 +00:00
Github Actions 45fbe693f5 [CI Skip] 0.15.0-beta.171 2019-10-13 19:05:44 +00:00
Github Actions e4fd0ad6df [CI Skip] 0.15.0-beta.170 2019-10-13 18:54:12 +00:00
Github Actions 63f7cdb4b7 [CI Skip] 0.15.0-beta.169 2019-10-13 18:43:00 +00:00
Github Actions aba850b6c9 [CI Skip] 0.15.0-beta.168 2019-10-13 18:31:11 +00:00
Github Actions c7aeb572dd [CI Skip] 0.15.0-beta.167 2019-10-13 18:19:08 +00:00
Github Actions e7e8d8a208 [CI Skip] 0.15.0-beta.166 2019-10-13 18:07:19 +00:00
Github Actions b285352df3 [CI Skip] 0.15.0-beta.165 2019-10-13 17:54:49 +00:00
Github Actions 39670ea9ee [CI Skip] 0.15.0-beta.164 2019-10-13 17:43:22 +00:00
Github Actions 3553f939d4 [CI Skip] 0.15.0-beta.163 2019-10-13 17:31:35 +00:00
Github Actions 462c90eed8 [CI Skip] 0.15.0-beta.162 2019-10-13 17:19:18 +00:00
Github Actions 1c7a209a83 [CI Skip] 0.15.0-beta.161 2019-10-13 17:07:43 +00:00
Github Actions f95c200aa0 [CI Skip] 0.15.0-beta.160 2019-10-13 16:55:23 +00:00
Github Actions 6865b98d39 [CI Skip] 0.15.0-beta.159 2019-10-13 16:43:05 +00:00
Github Actions e62e90666b [CI Skip] 0.15.0-beta.158 2019-10-13 16:31:50 +00:00
Github Actions bbacc24ee8 [CI Skip] 0.15.0-beta.157 2019-10-13 16:19:36 +00:00
Github Actions c4ced11a81 [CI Skip] 0.15.0-beta.156 2019-10-13 16:07:22 +00:00
Github Actions ce1a686926 [CI Skip] 0.15.0-beta.155 2019-10-13 15:55:35 +00:00
Github Actions 3225b9514d [CI Skip] 0.15.0-beta.154 2019-10-13 15:43:51 +00:00
Github Actions 0c28ddbd03 [CI Skip] 0.15.0-beta.153 2019-10-13 15:32:23 +00:00
Github Actions 3584e354a9 [CI Skip] 0.15.0-beta.152 2019-10-13 15:19:51 +00:00
Github Actions 837d308414 [CI Skip] 0.15.0-beta.151 2019-10-13 15:08:17 +00:00
Github Actions 8b5d7e6ad1 [CI Skip] 0.15.0-beta.150 2019-10-13 14:55:43 +00:00
Github Actions b605e99c8c [CI Skip] 0.15.0-beta.149 2019-10-13 14:43:27 +00:00
Github Actions db84a84ab9 [CI Skip] 0.15.0-beta.148 2019-10-13 14:30:43 +00:00
Github Actions 538ba3cee7 [CI Skip] 0.15.0-beta.147 2019-10-13 14:19:11 +00:00
Github Actions 249d33e88d [CI Skip] 0.15.0-beta.146 2019-10-13 14:06:58 +00:00
Github Actions b508b757b3 [CI Skip] 0.15.0-beta.145 2019-10-13 13:54:42 +00:00
Github Actions 7dfec78e7f [CI Skip] 0.15.0-beta.144 2019-10-13 13:42:43 +00:00
Github Actions 007d3ef42c [CI Skip] 0.15.0-beta.143 2019-10-13 13:30:20 +00:00
Github Actions 8968e50d8e [CI Skip] 0.15.0-beta.142 2019-10-13 13:18:17 +00:00
Github Actions 860ac9df24 [CI Skip] 0.15.0-beta.141 2019-10-13 13:06:01 +00:00
Github Actions 1d28086018 [CI Skip] 0.15.0-beta.140 2019-10-13 12:54:24 +00:00
Github Actions e437ce892c [CI Skip] 0.15.0-beta.139 2019-10-13 12:42:19 +00:00
Github Actions 273ad749c2 [CI Skip] 0.15.0-beta.138 2019-10-13 12:29:57 +00:00
Github Actions 99eb14e9b2 [CI Skip] 0.15.0-beta.137 2019-10-13 12:17:24 +00:00
Github Actions bbaee7325a [CI Skip] 0.15.0-beta.136 2019-10-13 12:05:11 +00:00
Github Actions 063d13e18d [CI Skip] 0.15.0-beta.135 2019-10-13 11:53:29 +00:00
Github Actions 9ce3f2cf9f [CI Skip] 0.15.0-beta.134 2019-10-13 11:41:52 +00:00
Github Actions 64d5140f03 [CI Skip] 0.15.0-beta.133 2019-10-13 11:29:40 +00:00
Github Actions 9236196c02 [CI Skip] 0.15.0-beta.132 2019-10-13 11:17:31 +00:00
Github Actions aa9b9286cc [CI Skip] 0.15.0-beta.131 2019-10-13 11:05:56 +00:00
Github Actions a649085e56 [CI Skip] 0.15.0-beta.130 2019-10-13 10:53:44 +00:00
Github Actions 5910f02ea1 [CI Skip] 0.15.0-beta.129 2019-10-13 10:42:14 +00:00
Github Actions dca5a6df90 [CI Skip] 0.15.0-beta.128 2019-10-13 10:30:39 +00:00
Github Actions 2a2428e1a5 [CI Skip] 0.15.0-beta.127 2019-10-13 10:19:30 +00:00
Github Actions 0ed359751a [CI Skip] 0.15.0-beta.126 2019-10-13 10:07:26 +00:00
Github Actions 024ffa3c5e [CI Skip] 0.15.0-beta.125 2019-10-13 09:56:12 +00:00
Github Actions a6e1d16905 [CI Skip] 0.15.0-beta.124 2019-10-13 09:44:35 +00:00
Github Actions 2f0c01e042 [CI Skip] 0.15.0-beta.123 2019-10-13 09:32:34 +00:00
Github Actions 03008cae4f [CI Skip] 0.15.0-beta.122 2019-10-13 09:21:23 +00:00
Github Actions 3e6bd38b8f [CI Skip] 0.15.0-beta.121 2019-10-13 09:10:13 +00:00
Github Actions 18b17b143b [CI Skip] 0.15.0-beta.120 2019-10-13 08:57:25 +00:00
Github Actions 2844ce085a [CI Skip] 0.15.0-beta.119 2019-10-13 08:45:27 +00:00
Github Actions 77909c9ba6 [CI Skip] 0.15.0-beta.118 2019-10-13 08:34:09 +00:00
Github Actions ef753fb65d [CI Skip] 0.15.0-beta.117 2019-10-13 08:22:43 +00:00
Github Actions a85b5d3a72 [CI Skip] 0.15.0-beta.116 2019-10-13 08:10:25 +00:00
Github Actions e2c8d1f3a2 [CI Skip] 0.15.0-beta.115 2019-10-13 07:58:21 +00:00
Github Actions 61b0126178 [CI Skip] 0.15.0-beta.114 2019-10-13 07:46:29 +00:00
Github Actions 3b672c8ca6 [CI Skip] 0.15.0-beta.113 2019-10-13 07:36:11 +00:00
Github Actions de18cff30c [CI Skip] 0.15.0-beta.112 2019-10-13 07:24:32 +00:00
Github Actions e626d1696d [CI Skip] 0.15.0-beta.111 2019-10-13 07:12:23 +00:00
Github Actions 69341f4482 [CI Skip] 0.15.0-beta.110 2019-10-13 06:59:34 +00:00
Github Actions 0adada79bb [CI Skip] 0.15.0-beta.109 2019-10-13 06:47:19 +00:00
Github Actions 67adc55627 [CI Skip] 0.15.0-beta.108 2019-10-13 06:35:44 +00:00
Github Actions 5d4a033e2c [CI Skip] 0.15.0-beta.107 2019-10-13 06:23:57 +00:00
Github Actions cd3341c6ec [CI Skip] 0.15.0-beta.106 2019-10-13 06:12:34 +00:00
Github Actions 56d4f5175f [CI Skip] 0.15.0-beta.105 2019-10-13 06:01:04 +00:00
Github Actions 96ea859573 [CI Skip] 0.15.0-beta.104 2019-10-13 05:49:00 +00:00
Github Actions 34a02db84b [CI Skip] 0.15.0-beta.103 2019-10-13 05:37:49 +00:00
Github Actions 1f0ff1c354 [CI Skip] 0.15.0-beta.102 2019-10-13 05:25:41 +00:00
Github Actions 22a27e7f84 [CI Skip] 0.15.0-beta.101 2019-10-13 05:13:51 +00:00
Github Actions bd8139ed2d [CI Skip] 0.15.0-beta.100 2019-10-13 05:02:45 +00:00
Github Actions 173cd0e11a [CI Skip] 0.15.0-beta.99 2019-10-13 04:49:59 +00:00
Github Actions 7b5cf39299 [CI Skip] 0.15.0-beta.98 2019-10-13 04:38:29 +00:00
Github Actions a19f2fff19 [CI Skip] 0.15.0-beta.97 2019-10-13 04:26:14 +00:00
Github Actions 7f681861c5 [CI Skip] 0.15.0-beta.96 2019-10-13 04:15:38 +00:00
Github Actions ad18d92ea0 [CI Skip] 0.15.0-beta.95 2019-10-13 04:04:08 +00:00
Github Actions 73a72470e3 [CI Skip] 0.15.0-beta.94 2019-10-13 03:52:40 +00:00
Github Actions 57a5e112fa [CI Skip] 0.15.0-beta.93 2019-10-13 03:41:19 +00:00
Github Actions 7357faf057 [CI Skip] 0.15.0-beta.92 2019-10-13 03:30:03 +00:00
Github Actions b4c739b184 [CI Skip] 0.15.0-beta.91 2019-10-13 03:18:39 +00:00
Github Actions cd8daafaaa [CI Skip] 0.15.0-beta.90 2019-10-13 03:06:33 +00:00
Github Actions bc39b735ba [CI Skip] 0.15.0-beta.89 2019-10-13 02:55:00 +00:00
Github Actions bb73f7ab43 [CI Skip] 0.15.0-beta.88 2019-10-13 02:43:29 +00:00
Github Actions 6c202bbe19 [CI Skip] 0.15.0-beta.87 2019-10-13 02:30:50 +00:00
Github Actions 79a7087cf8 [CI Skip] 0.15.0-beta.86 2019-10-13 02:18:13 +00:00
Github Actions e14d722350 [CI Skip] 0.15.0-beta.85 2019-10-13 02:06:30 +00:00
Github Actions 94e0cadc00 [CI Skip] 0.15.0-beta.84 2019-10-13 01:54:26 +00:00
Github Actions aedab18bca [CI Skip] 0.15.0-beta.83 2019-10-13 01:42:17 +00:00
Github Actions f0e9e7f790 [CI Skip] 0.15.0-beta.82 2019-10-13 01:30:40 +00:00
Github Actions 7dbf14084e [CI Skip] 0.15.0-beta.81 2019-10-13 01:18:21 +00:00
Github Actions 14118ac058 [CI Skip] 0.15.0-beta.80 2019-10-13 01:06:14 +00:00
Github Actions d7f2604933 [CI Skip] 0.15.0-beta.79 2019-10-13 00:54:25 +00:00
Github Actions 6897201132 [CI Skip] 0.15.0-beta.78 2019-10-13 00:42:35 +00:00
Github Actions fa77c76025 [CI Skip] 0.15.0-beta.77 2019-10-13 00:31:39 +00:00
Github Actions b6679e7fae [CI Skip] 0.15.0-beta.76 2019-10-13 00:19:07 +00:00
Github Actions 960419060b [CI Skip] 0.15.0-beta.75 2019-10-13 00:06:37 +00:00
Github Actions 379f2c175d [CI Skip] 0.15.0-beta.74 2019-10-12 23:55:23 +00:00
Github Actions 29394b37cc [CI Skip] 0.15.0-beta.73 2019-10-12 23:42:53 +00:00
Github Actions b96a04bdc6 [CI Skip] 0.15.0-beta.72 2019-10-12 23:31:34 +00:00
Github Actions f263d88684 [CI Skip] 0.15.0-beta.71 2019-10-12 23:18:14 +00:00
Github Actions 013448697d [CI Skip] 0.15.0-beta.70 2019-10-12 23:05:38 +00:00
Github Actions 77a5c59381 [CI Skip] 0.15.0-beta.69 2019-10-12 22:53:06 +00:00
Github Actions c4b0e5278d [CI Skip] 0.15.0-beta.68 2019-10-12 22:41:00 +00:00
Github Actions fa0bd6a57d [CI Skip] 0.15.0-beta.67 2019-10-12 22:28:22 +00:00
Github Actions 6920eeced6 [CI Skip] 0.15.0-beta.66 2019-10-12 22:16:08 +00:00
Github Actions c290dc1d68 [CI Skip] 0.15.0-beta.65 2019-10-12 22:03:14 +00:00
Github Actions 16f52c8d47 [CI Skip] 0.15.0-beta.64 2019-10-12 21:50:38 +00:00
Github Actions a99ffac9fb [CI Skip] 0.15.0-beta.63 2019-10-12 21:38:51 +00:00
Github Actions 24735d6386 [CI Skip] 0.15.0-beta.62 2019-10-12 21:27:31 +00:00
Github Actions ba00017218 [CI Skip] 0.15.0-beta.61 2019-10-12 21:14:33 +00:00
Github Actions a863dc61fb [CI Skip] 0.15.0-beta.60 2019-10-12 21:02:50 +00:00
Github Actions 9c574a5461 [CI Skip] 0.15.0-beta.59 2019-10-12 20:50:48 +00:00
Github Actions 2e9597de51 [CI Skip] 0.15.0-beta.58 2019-10-12 20:38:52 +00:00
Github Actions c492416534 [CI Skip] 0.15.0-beta.57 2019-10-12 20:28:00 +00:00
Github Actions 7a922c6942 [CI Skip] 0.15.0-beta.56 2019-10-12 20:17:13 +00:00
Github Actions 1fb7f9f1a4 [CI Skip] 0.15.0-beta.55 2019-10-12 20:03:11 +00:00
Github Actions 3278a0f5ab [CI Skip] 0.15.0-beta.54 2019-10-12 19:51:15 +00:00
Github Actions 97619eb27c [CI Skip] 0.15.0-beta.53 2019-10-12 19:40:00 +00:00
Github Actions 04edfe2725 [CI Skip] 0.15.0-beta.52 2019-10-12 19:28:10 +00:00
Github Actions e79fb448a3 [CI Skip] 0.15.0-beta.51 2019-10-12 19:15:10 +00:00
Github Actions 96dbe40681 [CI Skip] 0.15.0-beta.50 2019-10-12 19:04:23 +00:00
Github Actions 22bb4c2202 [CI Skip] 0.15.0-beta.49 2019-10-12 18:51:27 +00:00
Github Actions 1e25c033f1 [CI Skip] 0.15.0-beta.48 2019-10-12 18:39:16 +00:00
Github Actions 3627fd2d5f [CI Skip] 0.15.0-beta.47 2019-10-12 18:28:01 +00:00
Github Actions 85949e11d7 [CI Skip] 0.15.0-beta.46 2019-10-12 18:15:43 +00:00
Github Actions 0f7bdcd711 [CI Skip] 0.15.0-beta.45 2019-10-12 18:03:48 +00:00
Github Actions 828d44fbd4 [CI Skip] 0.15.0-beta.44 2019-10-12 17:51:45 +00:00
Github Actions f3c9ae14f4 [CI Skip] 0.15.0-beta.43 2019-10-12 17:39:30 +00:00
Github Actions e022247db7 [CI Skip] 0.15.0-beta.42 2019-10-12 17:26:52 +00:00
Github Actions b18fa247bd [CI Skip] 0.15.0-beta.41 2019-10-12 17:14:58 +00:00
Github Actions 33f09b6d1d [CI Skip] 0.15.0-beta.40 2019-10-12 17:02:45 +00:00
Github Actions 21159707c8 [CI Skip] 0.15.0-beta.39 2019-10-12 16:50:44 +00:00
Github Actions 7b11865751 [CI Skip] 0.15.0-beta.38 2019-10-12 16:38:22 +00:00
Github Actions 737ddf36c5 [CI Skip] 0.15.0-beta.37 2019-10-12 16:27:05 +00:00
Github Actions 3851d11ab5 [CI Skip] 0.15.0-beta.36 2019-10-12 16:14:46 +00:00
Github Actions 28233e9664 [CI Skip] 0.15.0-beta.35 2019-10-12 16:02:42 +00:00
Github Actions af535a67cc [CI Skip] 0.15.0-beta.34 2019-10-12 15:50:02 +00:00
Github Actions be6db81065 [CI Skip] 0.15.0-beta.33 2019-10-12 15:37:59 +00:00
Github Actions 9822c34dc7 [CI Skip] 0.15.0-beta.32 2019-10-12 15:25:31 +00:00
Github Actions b46005f180 [CI Skip] 0.15.0-beta.31 2019-10-12 15:13:40 +00:00
Github Actions 4ceec33fc7 [CI Skip] 0.15.0-beta.30 2019-10-12 15:01:45 +00:00
Github Actions ef78d10989 [CI Skip] 0.15.0-beta.29 2019-10-12 14:49:44 +00:00
Github Actions fe232a9ab4 [CI Skip] 0.15.0-beta.28 2019-10-12 14:37:31 +00:00
Github Actions da78a24aa3 [CI Skip] 0.15.0-beta.27 2019-10-12 14:24:57 +00:00
Github Actions 3c6e806db5 [CI Skip] 0.15.0-beta.26 2019-10-12 14:12:39 +00:00
Github Actions 0176c82db1 [CI Skip] 0.15.0-beta.25 2019-10-12 14:01:32 +00:00
Github Actions 98bb6453dd [CI Skip] 0.15.0-beta.24 2019-10-12 13:48:56 +00:00
Github Actions 839e4d3fa3 [CI Skip] 0.15.0-beta.23 2019-10-12 13:36:20 +00:00
Github Actions 91b55caf09 [CI Skip] 0.15.0-beta.22 2019-10-12 13:24:15 +00:00
Jaco Greeff b03aaa4bf7 Update build (#39) 2019-10-12 15:13:00 +02:00
Jaco Greeff 811411f606 [CI Skip] 0.15.0-beta.21 2019-10-09 16:22:33 +00:00
Jaco Greeff 107c410346 [CI Skip] 0.15.0-beta.20 2019-10-09 16:09:25 +00:00
Jaco Greeff 43d0bfaaf1 [CI Skip] 0.15.0-beta.19 2019-10-09 15:57:08 +00:00
Jaco Greeff 543c6a7512 [CI Skip] 0.15.0-beta.18 2019-10-09 15:44:25 +00:00
Jaco Greeff 9ee302fd79 [CI Skip] 0.15.0-beta.17 2019-10-09 15:31:29 +00:00
Jaco Greeff 30f7dc3549 [CI Skip] 0.15.0-beta.16 2019-10-09 15:19:26 +00:00
Jaco Greeff 5cab032133 [CI Skip] 0.15.0-beta.15 2019-10-09 15:06:43 +00:00
Jaco Greeff 6df8568f85 [CI Skip] 0.15.0-beta.14 2019-10-09 14:55:09 +00:00
Jaco Greeff f23f4eb986 [CI Skip] 0.15.0-beta.13 2019-10-09 14:43:36 +00:00
Jaco Greeff d0b3317c28 [CI Skip] 0.15.0-beta.12 2019-10-09 14:31:04 +00:00
Jaco Greeff 61b227436e [CI Skip] 0.15.0-beta.11 2019-10-09 14:18:38 +00:00
Jaco Greeff 1cc5190fa0 [CI Skip] 0.15.0-beta.10 2019-10-09 14:05:26 +00:00
Jaco Greeff 311ac2e0e3 [CI Skip] 0.15.0-beta.9 2019-10-09 13:52:33 +00:00
Jaco Greeff 52a14a7928 [CI Skip] 0.15.0-beta.8 2019-10-09 13:40:19 +00:00
Jaco Greeff 498e089342 [CI Skip] 0.15.0-beta.7 2019-10-09 13:25:01 +00:00
Jaco Greeff b75cb172ba [CI Skip] 0.15.0-beta.6 2019-10-09 13:12:09 +00:00
Jaco Greeff ab1952a3f5 [CI Skip] 0.15.0-beta.5 2019-10-09 12:58:55 +00:00
Jaco Greeff c46a890234 [CI Skip] 0.15.0-beta.4 2019-10-09 12:47:03 +00:00
Jaco Greeff 80d6d9f9ff [CI Skip] 0.15.0-beta.3 2019-10-09 12:34:25 +00:00
Jaco Greeff b3f006d5c0 [CI Skip] 0.15.0-beta.2 2019-10-09 12:21:13 +00:00
Jaco Greeff 0f16e58760 Swap CI to GH actions (#38)
* Swap CI to GH actions

* Ignore coverage
2019-10-09 14:08:39 +02:00
Travis CI 648adf840d [CI Skip] 0.15.0-beta.1 2019-10-08 12:30:29 +00:00
Jaco Greeff 0e50f267d1 Add GH actions (#37)
* Add GH actions

* Install nightly, test Rust seperately

* Nightly for tests

* Pin nightly version... maybe this works?

* Revert attempted version fix

* Re-try nightly pinning...

* Try without...

* Revert stable experiment

* Run action on PR

* Action only on PR

* Rename push.yml to pr.yml

* Bump deps, update actions

* Bump backtrace (maybe this helps?)

* Don't test rust alongside wasm (split)
2019-10-08 14:00:59 +02:00
Travis CI 2c02b44c0d [CI Skip] 0.15.0-beta.0 2019-09-11 10:49:11 +00:00
Jaco Greeff 416e0c58f8 Bump deps (#36) 2019-09-11 12:34:47 +02:00
53 changed files with 19984 additions and 12661 deletions
+1
View File
@@ -0,0 +1 @@
4
+4
View File
@@ -1 +1,5 @@
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
module.exports = require('./babel.config.js');
+4
View File
@@ -1,3 +1,7 @@
.eslintrc.js
.github/**
.vscode/**
.yarn/**
**/binaryen/*
**/build/*
**/coverage/*
+5 -1
View File
@@ -1,3 +1,7 @@
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const base = require('@polkadot/dev/config/eslint');
module.exports = {
@@ -5,7 +9,7 @@ module.exports = {
parserOptions: {
...base.parserOptions,
project: [
'./tsconfig.eslint.json'
'./tsconfig.json'
]
}
};
+16
View File
@@ -0,0 +1,16 @@
name: PR
on: [pull_request]
jobs:
pr:
strategy:
matrix:
step: ['lint', 'test', 'build']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: ${{ matrix.step }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
+34
View File
@@ -0,0 +1,34 @@
name: Master
on:
push:
branches:
- master
jobs:
master:
strategy:
matrix:
step: ['build:release']
name: ${{ matrix.step }}
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'polkadot-js/wasm'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.GH_PAT }}
- name: build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
dummy:
runs-on: ubuntu-latest
steps:
- name: dummy
run: |
echo "Dummy skip step"
+5 -1
View File
@@ -1,4 +1,4 @@
binaryen/
binaryen*
build/
build-docs/
coverage/
@@ -13,6 +13,10 @@ tmp/
.env.test.local
.env.production.local
.npmrc
.yarn/*
!.yarn/releases
!.yarn/plugins
.pnp.*
cc-test-reporter
lerna-debug.log*
npm-debug.log*
-36
View File
@@ -1,36 +0,0 @@
dist: xenial
language: node_js
node_js:
- "10"
env:
global:
- CC_TEST_REPORTER_ID=979056b20f7c89193ed7b4cdcd6bb6252231f069171fd73b072d0da6f5dd2338
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['cmake', 'g++-5']
cache:
cargo: true
yarn: true
directories:
- node_modules
compiler:
- clang
before_install:
- curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=nightly -y
- curl -o- -L https://yarnpkg.com/install.sh | bash
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- export PATH=$HOME/.yarn/bin:$HOME/.cargo/bin:$(yarn global bin):$PATH
before_script:
- ./cc-test-reporter before-build
script:
- yarn polkadot-dev-travis-build
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
deploy:
skip_cleanup: true
provider: script
script: yarn polkadot-dev-travis-deploy
on:
branch: master
+11
View File
@@ -0,0 +1,11 @@
{
"editor.tabSize": 2,
"files.eol": "\n",
"npm.packageManager": "yarn",
"eslint.enable": true,
"eslint.validate": [
"javascript",
"typescript",
"typescriptreact"
]
}
File diff suppressed because one or more lines are too long
Vendored Executable
+86
View File
File diff suppressed because one or more lines are too long
+11
View File
@@ -0,0 +1,11 @@
enableImmutableInstalls: false
enableProgressBars: false
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.js
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-2.1.1.js
+43 -14
View File
@@ -1,63 +1,92 @@
# 0.14.1
# CHANGELOG
## 1.3.1 Aug 9, 2020
- Add `scrypt` function for KDF generation
- Remove `bip39ToSeed`, we only use the `bip39ToMiniSecret` variant in Substrate
- Update ed25519-dalek to 1.0.0-pre.4
- Rework generation based on latest wasm-pack generator
## 1.2.1 Feb 29, 2020
- Adjust build process for smaller wasm bundle outputs (~50K dropped from base bundle)
- Unpin nightly from nightly-2020-02-17 version
- Swap to yarn 2 and add support for use by yarn 2 projects
## 1.1.1 Feb 24, 2020
- **Important** The sr25519 interface dropped the use of `verify_simple_preaudit_deprecated` for signature verification, instead it now uses `verify_simple`. Only schnorrkel 0.8+ signatures will now pass verification. This is a follow-up of the 0.1 signing support that was dropped in a previous version.
- Rework schnorrkel signatures test vectors based on the above change (Rust, WASM and ASM.js tests)
- Rust nightly pinned to last-known-working 2020-02-17 on CI (compiler issues, should to be reverted in a future release)
## 1.0.1 Feb 15, 2020
- No functionality changes from 0.20.1. The interfaces here are stable in the current iteration.
## 0.20.1 Jan 30, 2020
- Pull in schnorrkel 0.8.5 for full Substrate 2.x compatibility
## 0.14.1 Sep 09, 2019
- No functionality changes at all, everything done is "under the hood" to give the codebase better maintainability
# 0.13.1
## 0.13.1 Jul 20, 2019
- Added an asm.js fallback which is active for React Native via the `"react-native"` entry in `package.json`. Ensure that you run the build step with the `NODE_OPTIONS=--max_old_space_size=8192` flags, since the asm.js bundle is large. (For RN the full command would therefore be `NODE_OPTIONS=--max_old_space_size=8192 npm start`)
# 0.12.1
## 0.12.1 Jul 17, 2019
- Remove deprecated `@polkadot/wasm-schnorrkel` & `@polkadot/wasm-dalek-ed25519` source (all combined in `@polkadot/wasm-crypto`, was kept for historical purposes)
- Security dependency bumps
- Updated Rust `hex-literal` for recent versions of the compiler (used in tests only)
# 0.11.1
## 0.11.1 May 31, 2019
- Security dependency bumps
# 0.10.1
## 0.10.1 May 09, 2019
- w3f/schnorrkel updated to 0.1.1 as per substrate
- Added known subkey signature test (Rust & JS)
# 0.9.1
## 0.9.1 Apr 29, 2019
- Dependency bumps
# 0.8.1
## 0.8.1 Mar 31, 2019
- Pull ed25519 & sr25519 into `@polkadot/wasm-crypto` as well (smaller final size)
- Disable build/publish of `wasm-dalek-ed25519` & `wasm-schnorrkel`
- Improve error messaging, instead of `__wasm_malloc of null`
# 0.7.1
## 0.7.1 Mar 30, 2019
- Fix build scripts to properly attach errors in the log (dropped in 0.6.1)
# 0.6.1
## 0.6.1 Mar 27, 2019
- Log init errors for both non-WebAssembly usage as well as WebAssembly errors
# 0.5.1
## 0.5.1 Mar 23, 2019
- Add password argument to bip39ToSeed
# 0.4.1
## 0.4.1 Mar 23, 2019
- Add bip39ToSeed
# 0.3.1
## 0.3.1 Mar 23, 2019
- Add wasm-dalek-ed25519 for all used crypto there
- Add keccak256
- Try secp256k1 (bloating code, not used atm)
# 0.2.1
## 0.2.1 Mar 20, 2019
- Add basic crypto functions, creation of wasm-crypto package
- blake2, bip39, sha2, xxhash
# 0.1.1
## 0.1.1 Mar 18, 2019
- Initial release
+5 -3
View File
@@ -1,3 +1,5 @@
module.exports = {
extends: '@polkadot/dev/config/babel'
};
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
module.exports = require('@polkadot/dev/config/babel');
+6 -2
View File
@@ -1,4 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const config = require('@polkadot/dev/config/jest');
module.exports = Object.assign({}, config, {
@@ -7,5 +10,6 @@ module.exports = Object.assign({}, config, {
},
modulePathIgnorePatterns: [
'<rootDir>/packages/wasm-schnorrkel/build'
]
],
resolver: './jest.resolver.js'
});
+11
View File
@@ -0,0 +1,11 @@
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const path = require('path');
module.exports = function resolver (file, config) {
return file.includes('package.json')
? path.join(config.basedir.replace('/src', '/'), file)
: config.defaultResolver(file, config);
};
+1 -1
View File
@@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "0.14.1"
"version": "1.3.1"
}
+12 -15
View File
@@ -1,28 +1,25 @@
{
"version": "0.14.1",
"repository": "https://github.com/polkadot-js/wasm",
"author": "Jaco Greeff <jacogr@gmail.com>",
"license": "Apache-2",
"private": true,
"engines": {
"yarn": "^1.10.1"
},
"workspaces": [
"packages/*"
],
"resolutions": {
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.6.2"
"babel-core": "^7.0.0-bridge.0"
},
"scripts": {
"build": "./scripts/build.sh",
"check": "yarn lint",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
"build": "NIGHTLY= ./scripts/build.sh",
"build:release": "NIGHTLY= ./scripts/build-release.sh",
"lint": "polkadot-dev-run-lint",
"clean": "./scripts/clean.sh",
"postinstall": "polkadot-dev-yarn-only",
"test": "echo \"Tests included in build\""
"test": "./scripts/test-rust.sh"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@polkadot/dev": "^0.31.0-beta.7",
"@polkadot/util": "^1.2.0-beta.7",
"override-require": "^1.1.1"
}
"@babel/core": "^7.11.1",
"@polkadot/dev": "^0.55.35"
},
"version": "1.3.1"
}
+365 -385
View File
File diff suppressed because it is too large Load Diff
+14 -8
View File
@@ -15,23 +15,29 @@ version = "0.0.0"
crate-type = ["cdylib", "rlib"]
[dependencies]
backtrace = "0.3.38"
blake2-rfc = "0.2.18"
byteorder = "1.3.1"
ed25519-dalek = { version = "1.0.0-pre.1", features = ["nightly"] }
ed25519-dalek = { version = "1.0.0-pre.4", features = ["nightly"] }
hmac = "0.7.0"
# libsecp256k1 = "0.2.2"
pbkdf2 = { version = "0.3.0", default-features = false }
schnorrkel = { version = "0.1.1", features = ["nightly"] }
sha2 = "0.8.0"
tiny-bip39 = { version = "0.6.1", default-features = false }
tiny-keccak = "1.4.2"
twox-hash = "1.1.2"
wasm-bindgen = "0.2"
schnorrkel = { version = "0.9.1", features = ["nightly", "preaudit_deprecated", "u64_backend"] }
scrypt = { version = "0.2", default-features = false }
sha2 = "0.8.1"
tiny-bip39 = { version = "0.7", default-features = false }
tiny-keccak = { version = "2.0.1", features = ["keccak"] }
twox-hash = "1.5.0"
wasm-bindgen = "=0.2.65"
wee_alloc = "0.4.3"
[dev-dependencies]
hex-literal = "0.2.0"
rand = { version = "0.6.5", features = ["wasm-bindgen"] }
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
[profile.release]
lto = true
opt-level = "z"
[package.metadata.wasm-pack.profile.release]
wasm-opt = false
+6 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/wasm-crypto",
"version": "0.14.1",
"version": "1.3.1",
"author": "Jaco Greeff <jacogr@gmail.com>",
"files": [
"crypto-polyfill.js",
@@ -19,6 +19,11 @@
},
"main": "index.js",
"types": "index.d.ts",
"devDependencies": {
"@polkadot/dev": "^0.55.35",
"@polkadot/util": "^3.0.1",
"override-require": "^1.1.1"
},
"peerDependencies": {
"@polkadot/util": "*"
}
+2 -25
View File
@@ -1,8 +1,8 @@
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
use bip39::{Mnemonic, MnemonicType, Language, Seed};
use bip39::{Mnemonic, MnemonicType, Language};
use hmac::Hmac;
use pbkdf2::pbkdf2;
use sha2::Sha512;
@@ -48,20 +48,6 @@ pub fn ext_bip39_to_mini_secret(phrase: &str, password: &str) -> Vec<u8> {
result[..32].to_vec()
}
/// Creates a see from a bip-39 phrase
///
/// @phrase: mnemonic phrase
///
/// Returns a 32-byte seed
#[wasm_bindgen]
pub fn ext_bip39_to_seed(phrase: &str, password: &str) -> Vec<u8> {
let mnemonic = Mnemonic::from_phrase(phrase, Language::English).unwrap();
Seed::new(&mnemonic, password)
.as_bytes()[..32]
.to_vec()
}
/// Validates a bip39 phrase
///
/// * phrase: mnemonic phrase
@@ -99,15 +85,6 @@ pub mod tests {
assert_eq!(result[..], mini[..]);
}
#[test]
fn can_bip39_seed() {
let phrase = "seed sock milk update focus rotate barely fade car face mechanic mercy";
let seed = hex!("3c121e20de068083b49c2315697fb59a2d9e8643c24e5ea7628132c58969a027");
let result = ext_bip39_to_seed(phrase, "");
assert_eq!(result[..], seed[..]);
}
#[test]
fn can_bip39_generate() {
let phrase = ext_bip39_generate(12);
+18 -17
View File
@@ -1,8 +1,9 @@
// Copyright 2019 @polkadot/wasm-dalek-ed25519 authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signature};
use std::convert::TryFrom;
use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signature, Signer as _, Verifier as _};
use wasm_bindgen::prelude::*;
/// Keypair helper function.
@@ -14,27 +15,27 @@ fn create_from_pair(pair: &[u8]) -> Keypair {
}
/// Keypair helper function
fn create_from_parts(public: &[u8], secret: &[u8]) -> Keypair {
fn create_from_parts(pubkey: &[u8], seckey: &[u8]) -> Keypair {
let mut pair = vec![];
pair.extend_from_slice(secret);
pair.extend_from_slice(public);
pair.extend_from_slice(seckey);
pair.extend_from_slice(pubkey);
create_from_pair(&pair)
}
/// Keypair helper function.
fn create_from_seed(seed: &[u8]) -> Keypair {
let secret = SecretKey::from_bytes(seed).unwrap();
let public: PublicKey = (&secret).into();
let seckey = SecretKey::from_bytes(seed).unwrap();
let pubkey: PublicKey = (&seckey).into();
create_from_parts(public.as_bytes(), seed)
create_from_parts(pubkey.as_bytes(), seed)
}
/// PublicKey helper
fn create_public(public: &[u8]) -> PublicKey {
match PublicKey::from_bytes(public) {
Ok(public) => return public,
fn create_public(pubkey: &[u8]) -> PublicKey {
match PublicKey::from_bytes(pubkey) {
Ok(pubkey) => return pubkey,
Err(_) => panic!("Provided public key is invalid.")
}
}
@@ -57,14 +58,14 @@ pub fn ext_ed_from_seed(seed: &[u8]) -> Vec<u8> {
/// The combination of both public and private key must be provided.
/// This is effectively equivalent to a keypair.
///
/// * public: UIntArray with 32 element
/// * pubkey: UIntArray with 32 element
/// * private: UIntArray with 64 element
/// * message: Arbitrary length UIntArray
///
/// * returned vector is the signature consisting of 64 bytes.
#[wasm_bindgen]
pub fn ext_ed_sign(public: &[u8], secret: &[u8], message: &[u8]) -> Vec<u8> {
create_from_parts(public, secret)
pub fn ext_ed_sign(pubkey: &[u8], seckey: &[u8], message: &[u8]) -> Vec<u8> {
create_from_parts(pubkey, seckey)
.sign(message)
.to_bytes()
.to_vec()
@@ -76,13 +77,13 @@ pub fn ext_ed_sign(public: &[u8], secret: &[u8], message: &[u8]) -> Vec<u8> {
/// * message: Arbitrary length UIntArray
/// * pubkey: UIntArray with 32 element
#[wasm_bindgen]
pub fn ext_ed_verify(signature: &[u8], message: &[u8], public: &[u8]) -> bool {
let signature = match Signature::from_bytes(signature) {
pub fn ext_ed_verify(signature: &[u8], message: &[u8], pubkey: &[u8]) -> bool {
let signature = match Signature::try_from(signature) {
Ok(signature) => signature,
Err(_) => return false
};
create_public(public)
create_public(pubkey)
.verify(message, &signature)
.is_ok()
}
+43 -7
View File
@@ -1,4 +1,4 @@
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
@@ -6,15 +6,16 @@ use blake2_rfc::blake2b::blake2b;
use byteorder::{ByteOrder, LittleEndian};
use hmac::Hmac;
use pbkdf2::pbkdf2;
use scrypt::{ScryptParams, scrypt};
use sha2::{Digest, Sha512};
// use secp256k1;
use std::hash::Hasher;
use tiny_keccak::keccak256;
use tiny_keccak::{Hasher, Keccak};
use twox_hash::XxHash;
use wasm_bindgen::prelude::*;
/// helper function for a single twox round with a seed
fn create_twox(data: &[u8], seed: u64) -> [u8; 8] {
use ::std::hash::Hasher;
let mut hasher = XxHash::with_seed(seed);
hasher.write(data);
@@ -49,17 +50,22 @@ pub fn ext_blake2b(data: &[u8], key: &[u8], size: u32) -> Vec<u8> {
/// Returns the hash as a vector
#[wasm_bindgen]
pub fn ext_keccak256(data: &[u8]) -> Vec<u8> {
keccak256(data)
.to_vec()
let mut keccak = Keccak::v256();
let mut result = [0u8; 32];
keccak.update(data);
keccak.finalize(&mut result);
result.to_vec()
}
/// pbkdf2 hash from an input, salt for the number of specified rounds
/// pbkdf2 kdf from an input, salt for the number of specified rounds
///
/// * data: Arbitrary data to be hashed
/// * salt: Salt for this hash
/// * rounds: The number of rounds to perform
///
/// Returns a vecor with the hash result
/// Returns a vector with the hashed result
#[wasm_bindgen]
pub fn ext_pbkdf2(data: &[u8], salt: &[u8], rounds: u32) -> Vec<u8> {
let mut result = [0u8; 64];
@@ -70,6 +76,26 @@ pub fn ext_pbkdf2(data: &[u8], salt: &[u8], rounds: u32) -> Vec<u8> {
result.to_vec()
}
/// scrypt kdf from input, salt and config
///
/// * password: Password to hash
/// * salt: Salt for this hash
/// * log2_n: log2(n)
/// * r: r
/// * p: p
///
/// Returns vector with the hashed result
#[wasm_bindgen]
pub fn ext_scrypt(password: &[u8], salt: &[u8], log2_n: u8, r: u32, p: u32) -> Vec<u8> {
let params = ScryptParams::new(log2_n, r, p).unwrap();
let mut result = [0u8; 64];
match scrypt(password, salt, &params, &mut result) {
Ok(_) => return result.to_vec(),
Err(_) => panic!("Invalid scrypt hash.")
}
}
// /// Checks for the recoverability of a signature from message
// ///
// /// * message: The message
@@ -210,6 +236,16 @@ pub mod tests {
assert_eq!(hash[..], expected[..]);
}
#[test]
fn can_scrypt() {
let password = b"password";
let salt = b"salt";
let expected = hex!("745731af4484f323968969eda289aeee005b5903ac561e64a5aca121797bf7734ef9fd58422e2e22183bcacba9ec87ba0c83b7a2e788f03ce0da06463433cda6");
let hash = ext_scrypt(password, salt, 14, 8, 1);
assert_eq!(hash[..], expected[..]);
}
// #[test]
// fn can_secp256k1_real_eth_sig() {
// let sig = hex!("7505f2880114da51b3f5d535f8687953c0ab9af4ab81e592eaebebf53b728d2b6dfd9b5bcd70fee412b1f31360e7c2774009305cb84fc50c1d0ff8034dfa5fff1c");
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-wasm authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+4 -2
View File
@@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
/* eslint-disable sort-keys */
const { assert } = require('@polkadot/util');
const INIT_ERRROR = '@polkadot/wasm-crypto has not been initialized';
@@ -36,6 +37,7 @@ module.exports = function (stubbed) {
blake2b: wrapReady(stubbed.ext_blake2b),
keccak256: wrapReady(stubbed.ext_keccak256),
pbkdf2: wrapReady(stubbed.ext_pbkdf2),
scrypt: wrapReady(stubbed.ext_scrypt),
// secp256k1IsRecoverable: wrapReady(stubbed.ext_secp256k1_is_recoverable);
// secp256k1Recover: wrapReady(stubbed.ext_secp256k1_recover);
+2 -2
View File
@@ -1,11 +1,10 @@
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
export function bip39Generate (words: 12 | 15 | 18 | 21 | 24): string;
export function bip39ToEntropy (phrase: string): Uint8Array;
export function bip39ToMiniSecret (phrase: string, password: string): Uint8Array;
export function bip39ToSeed (phrase: string, password: string): Uint8Array;
export function bip39Validate (phrase: string): boolean;
export function ed25519KeypairFromSeed (seed: Uint8Array): Uint8Array;
@@ -22,6 +21,7 @@ export function sr25519Verify (signature: Uint8Array, message: Uint8Array, publi
export function blake2b (data: Uint8Array, key: Uint8Array, byteSize: number): Uint8Array;
export function keccak256 (data: Uint8Array): Uint8Array;
export function pbkdf2 (data: Uint8Array, salt: Uint8Array, rounds: number): Uint8Array;
export function scrypt (password: Uint8Array, salt: Uint8Array, log2N: number, r: number, p: number): Uint8Array;
// export function secp256k1IsRecoverable (message: Uint8Array, signature: Uint8Array): number;
// export function secp256k1Recover (message: Uint8Array, signature: Uint8Array): Uint8Array;
export function sha512 (data: Uint8Array): Uint8Array;
+1 -2
View File
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+2 -3
View File
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
@@ -10,7 +9,7 @@ const imports = require('./wasm');
module.exports = async function createExportPromise () {
try {
const { instance } = await WebAssembly.instantiate(bytes, { './wasm': imports });
const { instance } = await WebAssembly.instantiate(bytes, { __wbindgen_placeholder__: imports });
return instance.exports;
} catch (error) {
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+58 -60
View File
@@ -1,5 +1,5 @@
// Copyright 2019 Paritytech via https://github.com/paritytech/schnorrkel-js/
// Copyright 2019 @polkadot/wasm-schnorrkel authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
@@ -8,7 +8,7 @@
// forked at commit eff430ddc3090f56317c80654208b8298ef7ab3f
use schnorrkel::{
Keypair, MiniSecretKey, PublicKey, SecretKey, Signature,
ExpansionMode, Keypair, MiniSecretKey, PublicKey, SecretKey, Signature,
derive::{Derivation, ChainCode, CHAIN_CODE_LENGTH},
};
use wasm_bindgen::prelude::*;
@@ -25,38 +25,6 @@ fn create_cc(data: &[u8]) -> ChainCode {
ChainCode(cc)
}
/// Keypair helper function.
fn create_from_seed(seed: &[u8]) -> Keypair {
match MiniSecretKey::from_bytes(seed) {
Ok(mini) => return mini.expand_to_keypair(),
Err(_) => panic!("Provided seed is invalid.")
}
}
/// Keypair helper function.
fn create_from_pair(pair: &[u8]) -> Keypair {
match Keypair::from_bytes(pair) {
Ok(pair) => return pair,
Err(_) => panic!("Provided pair is invalid.")
}
}
/// PublicKey helper
fn create_public(public: &[u8]) -> PublicKey {
match PublicKey::from_bytes(public) {
Ok(public) => return public,
Err(_) => panic!("Provided public key is invalid.")
}
}
/// SecretKey helper
fn create_secret(secret: &[u8]) -> SecretKey {
match SecretKey::from_bytes(secret) {
Ok(secret) => return secret,
Err(_) => panic!("Provided private key is invalid.")
}
}
/// Perform a derivation on a secret
///
/// * secret: UIntArray with 64 bytes
@@ -65,10 +33,12 @@ fn create_secret(secret: &[u8]) -> SecretKey {
/// returned vector the derived keypair as a array of 96 bytes
#[wasm_bindgen]
pub fn ext_sr_derive_keypair_hard(pair: &[u8], cc: &[u8]) -> Vec<u8> {
create_from_pair(pair).secret
Keypair::from_half_ed25519_bytes(pair)
.unwrap()
.secret
.hard_derive_mini_secret_key(Some(create_cc(cc)), &[]).0
.expand_to_keypair()
.to_bytes()
.expand_to_keypair(ExpansionMode::Ed25519)
.to_half_ed25519_bytes()
.to_vec()
}
@@ -80,9 +50,10 @@ pub fn ext_sr_derive_keypair_hard(pair: &[u8], cc: &[u8]) -> Vec<u8> {
/// returned vector the derived keypair as a array of 96 bytes
#[wasm_bindgen]
pub fn ext_sr_derive_keypair_soft(pair: &[u8], cc: &[u8]) -> Vec<u8> {
create_from_pair(pair)
Keypair::from_half_ed25519_bytes(pair)
.unwrap()
.derived_key_simple(create_cc(cc), &[]).0
.to_bytes()
.to_half_ed25519_bytes()
.to_vec()
}
@@ -93,10 +64,12 @@ pub fn ext_sr_derive_keypair_soft(pair: &[u8], cc: &[u8]) -> Vec<u8> {
///
/// returned vector is the derived publicKey as a array of 32 bytes
#[wasm_bindgen]
pub fn ext_sr_derive_public_soft(public: &[u8], cc: &[u8]) -> Vec<u8> {
create_public(public)
pub fn ext_sr_derive_public_soft(pubkey: &[u8], cc: &[u8]) -> Vec<u8> {
PublicKey::from_bytes(pubkey)
.unwrap()
.derived_key_simple(create_cc(cc), &[]).0
.to_bytes().to_vec()
.to_bytes()
.to_vec()
}
/// Generate a key pair.
@@ -107,8 +80,23 @@ pub fn ext_sr_derive_public_soft(public: &[u8], cc: &[u8]) -> Vec<u8> {
/// followed by the public key (32) bytes.
#[wasm_bindgen]
pub fn ext_sr_from_seed(seed: &[u8]) -> Vec<u8> {
create_from_seed(seed)
.to_bytes()
MiniSecretKey::from_bytes(seed)
.unwrap()
.expand_to_keypair(ExpansionMode::Ed25519)
.to_half_ed25519_bytes()
.to_vec()
}
/// Generate a key pair from a known pair. (This is not exposed via WASM)
///
/// * seed: UIntArray with 96 element
///
/// returned vector is the concatenation of first the private key (64 bytes)
/// followed by the public key (32) bytes.
pub fn ext_sr_from_pair(pair: &[u8]) -> Vec<u8> {
Keypair::from_half_ed25519_bytes(pair)
.unwrap()
.to_half_ed25519_bytes()
.to_vec()
}
@@ -117,15 +105,16 @@ pub fn ext_sr_from_seed(seed: &[u8]) -> Vec<u8> {
/// The combination of both public and private key must be provided.
/// This is effectively equivalent to a keypair.
///
/// * public: UIntArray with 32 element
/// * pubkey: UIntArray with 32 element
/// * private: UIntArray with 64 element
/// * message: Arbitrary length UIntArray
///
/// * returned vector is the signature consisting of 64 bytes.
#[wasm_bindgen]
pub fn ext_sr_sign(public: &[u8], secret: &[u8], message: &[u8]) -> Vec<u8> {
create_secret(secret)
.sign_simple(SIGNING_CTX, message, &create_public(public))
pub fn ext_sr_sign(pubkey: &[u8], secret: &[u8], message: &[u8]) -> Vec<u8> {
SecretKey::from_ed25519_bytes(secret)
.unwrap()
.sign_simple(SIGNING_CTX, message, &PublicKey::from_bytes(pubkey).unwrap())
.to_bytes()
.to_vec()
}
@@ -136,14 +125,13 @@ pub fn ext_sr_sign(public: &[u8], secret: &[u8], message: &[u8]) -> Vec<u8> {
/// * message: Arbitrary length UIntArray
/// * pubkey: UIntArray with 32 element
#[wasm_bindgen]
pub fn ext_sr_verify(signature: &[u8], message: &[u8], public: &[u8]) -> bool {
let signature = match Signature::from_bytes(signature) {
Ok(signature) => signature,
Err(_) => return false
};
create_public(public)
.verify_simple(SIGNING_CTX, message, &signature)
pub fn ext_sr_verify(signature: &[u8], message: &[u8], pubkey: &[u8]) -> bool {
match Signature::from_bytes(signature) {
Ok(signature) => PublicKey::from_bytes(pubkey).unwrap()
.verify_simple(SIGNING_CTX, message, &signature)
.is_ok(),
Err(_) => false
}
}
#[cfg(test)]
@@ -168,7 +156,7 @@ pub mod tests {
}
#[test]
fn creates_pair_from_known() {
fn creates_pair_from_known_seed() {
let seed = hex!("fac7959dbfe72f052e5a0c3c8d6530f202b02fd8f9f5ca3580ec8deb7797479e");
let expected = hex!("46ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a");
let keypair = ext_sr_from_seed(&seed);
@@ -177,6 +165,16 @@ pub mod tests {
assert_eq!(public, expected);
}
#[test]
fn create_pair_from_known_pair() {
let input = hex!("28b0ae221c6bb06856b287f60d7ea0d98552ea5a16db16956849aa371db3eb51fd190cce74df356432b410bd64682309d6dedb27c76845daf388557cbac3ca3446ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a");
let keypair = ext_sr_from_pair(&input);
let expected = hex!("46ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a");
let public = &keypair[SECRET_KEY_LENGTH..KEYPAIR_LENGTH];
assert_eq!(public, expected);
}
#[test]
fn can_sign_message() {
let seed = generate_random_seed();
@@ -204,9 +202,9 @@ pub mod tests {
#[test]
fn can_verify_known_message() {
let message = b"Verifying that I am the owner of 5G9hQLdsKQswNPgB499DeA5PkFBbgkLPJWkkS6FAM6xGQ8xD. Hash: 221455a3\n";
let public = hex!("b4bfa1f7a5166695eb75299fd1c4c03ea212871c342f2c5dfea0902b2c246918");
let signature = hex!("5a9755f069939f45d96aaf125cf5ce7ba1db998686f87f2fb3cbdea922078741a73891ba265f70c31436e18a9acd14d189d73c12317ab6c313285cd938453202");
let message = b"I hereby verify that I control 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
let public = hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d");
let signature = hex!("1037eb7e51613d0dcf5930ae518819c87d655056605764840d9280984e1b7063c4566b55bf292fcab07b369d01095879b50517beca4d26e6a65866e25fec0d83");
let is_valid = ext_sr_verify(&signature, message, &public);
assert!(is_valid);
+4 -13
View File
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/camelcase */
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// @ts-check
/* eslint-disable camelcase */
const { assert, u8aToHex } = require('@polkadot/util');
function bip39_generate (wasm) {
@@ -39,18 +39,9 @@ function bip39_toMiniSecret (wasm) {
assert(RESULT === '0x4313249608fe8ac10fd5886c92c4579007272cb77c21551ee5b8d60b78041685', 'ERROR: Invalid bip39 mini secret');
}
function bip39_toSeed (wasm) {
const RESULT = u8aToHex(wasm.bip39ToSeed('seed sock milk update focus rotate barely fade car face mechanic mercy', ''));
console.log('\tSEE', RESULT);
assert(RESULT === '0x3c121e20de068083b49c2315697fb59a2d9e8643c24e5ea7628132c58969a027', 'ERROR: Invalid bip39 mini secret');
}
module.exports = {
bip39_generate,
bip39_validate,
bip39_toEntropy,
bip39_toMiniSecret,
bip39_toSeed
bip39_validate
};
+5 -6
View File
@@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/camelcase */
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// @ts-check
/* eslint-disable camelcase */
const crypto = require('crypto');
const { assert, hexToU8a, stringToU8a, u8aToHex } = require('@polkadot/util');
@@ -55,8 +54,8 @@ function ed25519_benchmark (wasm) {
}
module.exports = {
ed25519_benchmark,
ed25519_pairFromSeed,
ed25519_signAndVerify,
ed25519_verifyExisting,
ed25519_benchmark
ed25519_verifyExisting
};
+12 -4
View File
@@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/camelcase */
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// @ts-check
/* eslint-disable camelcase */
const { assert, stringToU8a, u8aToHex } = require('@polkadot/util');
@@ -42,6 +41,14 @@ function pbkdf2Hash (wasm) {
// assert(pk === '0x91d366769d44a7c7690428bfdf67ec7eae23d2459694685257b6fc59d1baa1fe', 'ERROR: secp256k1Recover does not match');
// }
function scryptHash (wasm) {
const hash = u8aToHex(wasm.scrypt(stringToU8a('password'), stringToU8a('salt'), 14, 8, 1));
console.log('\tRES', hash);
assert(hash === '0x745731af4484f323968969eda289aeee005b5903ac561e64a5aca121797bf7734ef9fd58422e2e22183bcacba9ec87ba0c83b7a2e788f03ce0da06463433cda6', 'ERROR: scryptHash does not match');
}
function sha512Hash (wasm) {
const hash = u8aToHex(wasm.sha512(stringToU8a('hello world')));
@@ -64,6 +71,7 @@ module.exports = {
blake2bHash,
keccak256,
pbkdf2Hash,
scryptHash,
// secp256k1Recover,
sha512Hash,
twoxHash
+1 -2
View File
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+10 -11
View File
@@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/camelcase */
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// @ts-check
/* eslint-disable camelcase */
const crypto = require('crypto');
const { assert, hexToU8a, stringToU8a, u8aToHex } = require('@polkadot/util');
@@ -35,9 +34,9 @@ function sr25519_devFromSeed (wasm) {
}
function sr25519_verifyExisting (wasm) {
const PK = hexToU8a('0xb4bfa1f7a5166695eb75299fd1c4c03ea212871c342f2c5dfea0902b2c246918');
const MESSAGE = stringToU8a('Verifying that I am the owner of 5G9hQLdsKQswNPgB499DeA5PkFBbgkLPJWkkS6FAM6xGQ8xD. Hash: 221455a3\n');
const SIGNATURE = hexToU8a('0x5a9755f069939f45d96aaf125cf5ce7ba1db998686f87f2fb3cbdea922078741a73891ba265f70c31436e18a9acd14d189d73c12317ab6c313285cd938453202');
const PK = hexToU8a('0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d');
const MESSAGE = stringToU8a('I hereby verify that I control 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
const SIGNATURE = hexToU8a('0xb83881d3bd7302981ee1c504fe5b7b394682927131fc0846fd616bb40fa14d02640fd2aca785b4cb57904765c2e4e75f59a7dd30154c209964369912091f6981');
const isValid = wasm.sr25519Verify(SIGNATURE, MESSAGE, PK);
@@ -112,14 +111,14 @@ function sr25519_benchmark (wasm) {
}
module.exports = {
sr25519_pairFromSeed,
sr25519_devFromSeed,
sr25519_benchmark,
sr25519_deriveHard,
sr25519_deriveHardKnown,
sr25519_deriveSoft,
sr25519_deriveSoftKnown,
sr25519_deriveSoftPubkey,
sr25519_devFromSeed,
sr25519_pairFromSeed,
sr25519_signAndVerify,
sr25519_verifyExisting,
sr25519_benchmark
sr25519_verifyExisting
};
+1 -2
View File
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+1 -2
View File
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
+1 -3
View File
@@ -1,8 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2019 @polkadot/wasm-crypto authors & contributors
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// @ts-check
const { runUnassisted } = require('./all');
+36 -14
View File
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
@@ -17,7 +20,7 @@ rm -rf ./build ./pkg
# build new via nightly & wasm-pack
echo "*** Building WASM output"
rustup run nightly wasm-pack build --release --scope polkadot --target nodejs
rustup run nightly$NIGHTLY wasm-pack build --release --scope polkadot --target nodejs
mv pkg build
# optimise
@@ -32,36 +35,55 @@ node ../../scripts/pack-wasm-base64.js
echo "*** Building asm.js version"
../../binaryen/bin/wasm2js --output $ASM $OPT
# cleanup the generated output, sadly there are no node-js outputs above
sed -i -e 's/import {/\/\/ import {/g' $ASM
sed -i -e 's/function asmFunc/var schnorrkel = require('\''\.\/wasm'\''); function asmFunc/g' $ASM
sed -i -e 's/{abort.*},memasmFunc/schnorrkel, memasmFunc/g' $ASM
# cleanup the generated asm, converting to cjs
sed -i -e '/import {/d' $ASM
echo "const imported = require('./wasm');
$(cat $ASM)" > $ASM
sed -i -e 's/{abort.*},memasmFunc/imported, memasmFunc/g' $ASM
sed -i -e 's/export var /module\.exports\./g' $ASM
# copy our package interfaces
echo "*** Copying package sources"
cp src/js/* build/
echo "const crypto = require('crypto');
const { stringToU8a, u8aToString } = require('@polkadot/util');
const requires = { crypto };
$(cat $SRC_WASM)
" > $SRC_WASM
# whack comments
sed -i -e '/^\/\*\*/d' $SRC_WASM
sed -i -e '/^\*/d' $SRC_WASM
sed -i -e '/^\*\//d' $SRC_WASM
# we are swapping to a async interface for webpack support (wasm limits)
sed -i -e 's/wasm = require/\/\/ wasm = require/g' $SRC_WASM
sed -i -e '/^wasm = require/d' $SRC_WASM
# We don't want inline requires
sed -i -e 's/var wasm;/const crypto = require('\''crypto'\''); let wasm; const requires = { crypto };/g' $SRC_WASM
sed -i -e 's/return addHeapObject(require(varg0));/return addHeapObject(requires[varg0]);/g' $SRC_WASM
sed -i -e 's/ret = require(getStringFromWasm0(arg0, arg1));/ret = requires[getStringFromWasm0(arg0, arg1)];/g' $SRC_WASM
# this creates issues in both the browser and RN (@polkadot/util has a polyfill)
sed -i -e 's/const TextEncoder = require('\''util'\'')\.TextEncoder;/const { stringToU8a } = require('\''@polkadot\/util'\'');/g' $SRC_WASM
sed -i -e 's/let cachedTextEncoder = new /\/\/ let cachedTextEncoder = new /g' $SRC_WASM
sed -i -e '/^const { TextEncoder } = require/d' $SRC_WASM
sed -i -e '/^let cachedTextEncoder = new /d' $SRC_WASM
sed -i -e 's/cachedTextEncoder\.encode/stringToU8a/g' $SRC_WASM
# this creates issues in both the browser and RN (@polkadot/util has a polyfill)
sed -i -e 's/const TextDecoder = require('\''util'\'')\.TextDecoder;/const { u8aToString } = require('\''@polkadot\/util'\'');/g' $SRC_WASM
sed -i -e 's/let cachedTextDecoder = new /\/\/ let cachedTextDecoder = new /g' $SRC_WASM
sed -i -e '/^const { TextDecoder } = require/d' $SRC_WASM
sed -i -e '/^let cachedTextDecoder = new/d' $SRC_WASM
sed -i -e 's/cachedTextDecoder\.decode/u8aToString/g' $SRC_WASM
# this is where we get the actual bg file
sed -i -e '/^const path = require/d' $SRC_WASM
sed -i -e '/^const bytes = require/d' $SRC_WASM
sed -i -e '/^const wasmModule =/d' $SRC_WASM
sed -i -e '/^const wasmInstance =/d' $SRC_WASM
sed -i -e '/^wasm = wasmInstance/d' $SRC_WASM
# construct our promise and add ready helpers (WASM)
echo "
module.exports.abort = function () { throw new Error('abort'); };
echo "module.exports.abort = function () { throw new Error('abort'); };
const createPromise = require('./wasm_promise');
const wasmPromise = createPromise().catch(() => null);
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
rustup toolchain install nightly$NIGHTLY
yarn polkadot-ci-ghact-build
+4
View File
@@ -1,7 +1,11 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
rustup toolchain install nightly$NIGHTLY
./scripts/install-build-deps.sh
echo "*** Building packages"
+3
View File
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
+32 -13
View File
@@ -1,28 +1,47 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
# wasm2js for wasm -> asm.js
BINARYEN=( "wasm-opt" "wasm2js" )
unamestr=`uname`
# install wasm-pack as required
if ! [ -x "$(command -v wasm-pack)" ]; then
echo "*** Installing wasm-pack"
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
fi
# install binaryen as required
if [ ! -d "binaryen" ]; then
echo "*** Installing binaryen"
git clone --recursive https://github.com/WebAssembly/binaryen.git
rm -rf binaryen/test
# CI, Linux
if [[ "$unamestr" == 'Linux' ]]; then
if [ ! -d "binaryen" ]; then
echo "*** Downloading binaryen"
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_91/binaryen-version_91-x86-linux.tar.gz | tar xz
mkdir -p binaryen/bin
for BIN in "${BINARYEN[@]}"; do
mv binaryen-version_91/$BIN binaryen/bin
done
fi
else
# install binaryen as required
if [ ! -d "binaryen" ]; then
echo "*** Cloning binaryen"
git clone --recursive https://github.com/WebAssembly/binaryen.git
rm -rf binaryen/test
fi
for BIN in "${BINARYEN[@]}"; do
if [ ! -f "binaryen/bin/$BIN" ]; then
echo "*** Building $BIN"
cd binaryen
cmake . && make $BIN
cd ..
fi
done
fi
for BIN in "${BINARYEN[@]}"; do
if [ ! -f "binaryen/bin/$BIN" ]; then
echo "*** Building $BIN"
cd binaryen
cmake . && make $BIN
cd ..
fi
done
+4
View File
@@ -1,3 +1,7 @@
// Copyright 2019-2020 @polkadot/wasm authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
const buffer = fs.readFileSync('./build/wasm_opt.wasm');
+4 -6
View File
@@ -1,12 +1,10 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
echo "*** Testing package"
echo "*** Testing Rust"
RUST_BACKTRACE=full rustup run nightly cargo test --release -- --nocapture
echo "*** Testing WASM"
node ./test/wasm.js
@@ -14,4 +12,4 @@ echo "*** Testing ASM.js"
node ./test/asm.js
echo "*** Testing via Jest"
yarn jest ./test/jest.spec.js
yarn polkadot-dev-run-test ./test/jest.spec.js
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2019-2020 @polkadot/wasm authors & contributors
# This software may be modified and distributed under the terms
# of the Apache-2.0 license. See the LICENSE file for details.
set -e
rustup toolchain install nightly$NIGHTLY
cd packages
PACKAGES=( $(ls -1d *) )
for PKG in "${PACKAGES[@]}"; do
if [ -f "$PKG/package.json" ]; then
cd $PKG
echo "*** Testing Rust $PKG"
RUST_BACKTRACE=full rustup run nightly$NIGHTLY cargo test --release -- --nocapture
cd ..
fi
done
cd ..
-11
View File
@@ -1,11 +0,0 @@
{
"extends": "./tsconfig.json",
"exclude": [
"build",
"packages/*/build"
],
"compilerOptions": {
"allowJs": true,
"checkJs": true
}
}
+6 -1
View File
@@ -1,10 +1,15 @@
{
"extends": "./node_modules/@polkadot/dev/config/tsconfig",
"extends": "@polkadot/dev/config/tsconfig",
"exclude": [
"build/**/*",
"**/build/**/*"
],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@polkadot/wasm-schnorrkel": [ "packages/wasm-schnorrkel/src" ]
},
"skipLibCheck": true,
"typeRoots": [
"./node_modules/@polkadot/ts",
"./node_modules/@types"
-3
View File
@@ -1,3 +0,0 @@
{
"extends": "@polkadot/dev/config/tslint"
}
+8 -4
View File
@@ -1,16 +1,20 @@
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
module.exports = {
name: 'Polkadot JS WASM',
exclude: '**/*+(index|e2e|spec).ts',
excludeExternals: true,
excludeNotExported: true,
excludeProtected: true,
excludePrivate: true,
excludeProtected: true,
hideGenerator: true,
includeDeclarations: false,
out: 'docs',
mdEngine: 'gitbook',
module: 'commonjs',
moduleResolution: 'node',
mdEngine: 'gitbook',
name: 'Polkadot JS WASM',
out: 'docs',
stripInternal: 'true',
theme: 'markdown'
};
+18999 -11977
View File
File diff suppressed because it is too large Load Diff