Skip to content

Commit 531b533

Browse files
authored
upgrade (#17)
* update teps * update deps * travis fix * travis * purescript-bytestrings v8.0.0
1 parent 0b77129 commit 531b533

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ node_js: stable
55
install:
66
- npm install -g bower
77
- npm install
8-
- bower install
8+
- bower install --production
99
script:
10+
- npm run -s build-strict
11+
- bower install
1012
- npm run -s test
1113
after_success:
1214
- >-

bower.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
],
2020
"dependencies": {
2121
"purescript-prelude": "^4.0.0",
22-
"purescript-ring-modules": "^5.0.0",
23-
"purescript-foreign-generic": "^8.0.0",
24-
"purescript-simple-json": "^4.0.0",
22+
"purescript-ring-modules": "^5.0.1",
23+
"purescript-foreign-generic": "^10.0.0",
24+
"purescript-simple-json": "^7.0.0",
2525
"purescript-ordered-collections": "^1.0.0",
26-
"purescript-bytestrings": "^7.0.0",
27-
"purescript-argonaut": "^5.0.0",
28-
"purescript-parsing": "5.0.0"
26+
"purescript-bytestrings": "^8.0.0",
27+
"purescript-argonaut": "^6.0.0",
28+
"purescript-parsing": "^5.0.0"
2929
},
3030
"devDependencies": {
3131
"purescript-psci-support": "^4.0.0",

package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
{
22
"name": "purescript-eth-core",
3-
"version": "4.0.0",
4-
"description": "",
5-
"main": "index.js",
3+
"private": true,
64
"dependencies": {
75
"bn.js": "^4.11.0",
86
"keccak": "^1.0.2",
97
"rlp": "^2.0.0",
108
"secp256k1": "^3.0.1"
119
},
1210
"devDependencies": {
13-
"purescript-psa": "^0.6.0",
14-
"purescript": "^0.12.0",
15-
"pulp": "^12.2.0"
11+
"purescript-psa": "^0.7.3",
12+
"purescript": "^0.13.0",
13+
"pulp": "^13.0.0"
1614
},
1715
"scripts": {
16+
"build-strict": "pulp build -- --strict",
1817
"test": "pulp test"
19-
},
20-
"author": "",
21-
"license": "ISC"
18+
}
2219
}

src/Network/Ethereum/Core/HexString.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ toAscii hx = flip BS.toString ASCII $ unsafePartial $ fromJust $ BS.fromString (
213213
-- | Get the 'HexString' corresponding to the UTF8 encoding.
214214
fromUtf8 :: String -> HexString
215215
fromUtf8 s = unsafePartial fromJust $
216-
let s' = unsafePartial $ split (Pattern "\0000") s `unsafeIndex` 0
216+
let s' = unsafePartial $ split (Pattern "\x0000") s `unsafeIndex` 0
217217
in BS.fromString s' UTF8 >>= (pure <<< flip BS.toString Hex) >>= mkHexString
218218

219219
-- | Get the 'HexString' corresponding to the ASCII encoding.

test/Spec/Hex.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ hexSpec = describe "hex-spec" do
3131

3232
it "can convert hex strings to utf8" do
3333
toUtf8 (unsafePartial (fromJust <<< mkHexString) "6d79537472696e67") `shouldEqual` "myString"
34-
toUtf8 (unsafePartial (fromJust <<< mkHexString) "6d79537472696e6700") `shouldEqual` "myString\00"
34+
toUtf8 (unsafePartial (fromJust <<< mkHexString) "6d79537472696e6700") `shouldEqual` "myString\x00"
3535
toUtf8 (unsafePartial (fromJust <<< mkHexString) "65787065637465642076616c7565000000000000000000000000000000000000")
36-
`shouldEqual` "expected value\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
36+
`shouldEqual` "expected value\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3737

3838
it "can convert strings to hex" do
3939
fromUtf8 "myString" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "6d79537472696e67"
40-
fromUtf8 "myString\00" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "6d79537472696e67"
41-
fromUtf8 "expected value\00\00\00" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "65787065637465642076616c7565"
40+
fromUtf8 "myString\x00" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "6d79537472696e67"
41+
fromUtf8 "expected value\x00\x00\x00" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "65787065637465642076616c7565"
4242

4343
describe "ascii tests" do
4444

4545
it "can convert hex strings to ascii" do
4646

4747
toAscii (unsafePartial (fromJust <<< mkHexString) "6d79537472696e67") `shouldEqual` "myString"
48-
toAscii (unsafePartial (fromJust <<< mkHexString) "6d79537472696e6700") `shouldEqual` "myString\0000"
48+
toAscii (unsafePartial (fromJust <<< mkHexString) "6d79537472696e6700") `shouldEqual` "myString\x0000"
4949
-- toAscii ((fromJust <<< mkHexString) "0300000035e8c6d54c5d127c9dcebe9e1a37ab9b05321128d097590a3c100000000000006521df642ff1f5ec0c3a7aa6cea6b1e7b7f7cda2cbdf07362a85088e97f19ef94331c955c0e9321ad386428c")
50-
-- `shouldEqual` "\0003\0000\0000\00005èÆÕL]\0012|Î¾ž\001a7«›\00052\0011(ЗY\n<\0010\0000\0000\0000\0000\0000\0000e!ßd/ñõì\f:z¦Î¦±ç·÷Í¢Ëß\00076*…\bŽ—ñžùC1ÉUÀé2\001aӆBŒ"
50+
-- `shouldEqual` "\x0003\x0000\x0000\x00005èÆÕL]\x0012|Î¾ž\x001a7«›\x00052\x0011(ЗY\n<\x0010\x0000\x0000\x0000\x0000\x0000\x0000e!ßd/ñõì\f:z¦Î¦±ç·÷Í¢Ëß\x00076*…\bŽ—ñžùC1ÉUÀé2\x001aӆBŒ"
5151

5252
it "can convert asci to hex" do
5353
fromAscii "myString" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "6d79537472696e67"
54-
fromAscii "myString\00" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "6d79537472696e6700"
54+
fromAscii "myString\x00" `shouldEqual` unsafePartial (fromJust <<< mkHexString) "6d79537472696e6700"
5555

5656
describe "json tests" do
5757

0 commit comments

Comments
 (0)