Bump util, min compact bitlength (#516)

This commit is contained in:
Jaco Greeff
2018-12-25 13:58:58 +01:00
committed by GitHub
parent 9e512bd6a0
commit 85434e082b
7 changed files with 30 additions and 35 deletions
+1 -1
View File
@@ -33,6 +33,6 @@
"@polkadot/jsonrpc": "^0.35.9",
"@polkadot/rpc-provider": "^0.35.9",
"@polkadot/types": "^0.35.9",
"@polkadot/util": "^0.33.26"
"@polkadot/util": "^0.33.27"
}
}
+3 -3
View File
@@ -30,10 +30,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.2.0",
"@polkadot/keyring": "^0.33.26",
"@polkadot/keyring": "^0.33.27",
"@polkadot/storage": "^0.35.9",
"@polkadot/util": "^0.33.26",
"@polkadot/util-crypto": "^0.33.26",
"@polkadot/util": "^0.33.27",
"@polkadot/util-crypto": "^0.33.27",
"@types/nock": "^9.3.0",
"eventemitter3": "^3.1.0",
"isomorphic-fetch": "^2.2.1",
+1 -1
View File
@@ -12,6 +12,6 @@
"dependencies": {
"@babel/runtime": "^7.2.0",
"@polkadot/types": "^0.35.9",
"@polkadot/util": "^0.33.26"
"@polkadot/util": "^0.33.27"
}
}
+3 -3
View File
@@ -30,9 +30,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-storage#readme",
"dependencies": {
"@babel/runtime": "^7.2.0",
"@polkadot/keyring": "^0.33.26",
"@polkadot/keyring": "^0.33.27",
"@polkadot/types": "^0.35.9",
"@polkadot/util": "^0.33.26",
"@polkadot/util-crypto": "^0.33.26"
"@polkadot/util": "^0.33.27",
"@polkadot/util-crypto": "^0.33.27"
}
}
+2 -2
View File
@@ -30,8 +30,8 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.2.0",
"@polkadot/keyring": "^0.33.26",
"@polkadot/util": "^0.33.26",
"@polkadot/keyring": "^0.33.27",
"@polkadot/util": "^0.33.27",
"core-js": "^2.6.1"
}
}
+5 -10
View File
@@ -61,19 +61,14 @@ describe('Compact', () => {
);
});
// FIXME This is _still_ not correct, here it should use the minimum bytes - however, since the
// value fits and the encoding is proper, it _should_ be ok on the decoding side.
it('condes a large balance', () => {
it('encondes a large balance', () => {
expect(
Compact.encodeU8a(new Balance('0x00407a10f35a'))
).toEqual(
new Uint8Array([
// length, as per FIXME, should actually be 6 (as opposed to 16)
3 + ((16 - 4) << 2),
// useful data
0x00, 0x40, 0x7a, 0x10, 0xf3, 0x5a,
// padding, extra space used here :(
0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
3 + ((6 - 4) << 2),
0x00, 0x40, 0x7a, 0x10, 0xf3, 0x5a
])
);
});
});
@@ -120,7 +115,7 @@ describe('Compact', () => {
it('has the correct encodedLength for constructor values (BlockNumber)', () => {
expect(
new Compact(BlockNumber, 0xfffffff9).encodedLength
).toEqual(9);
).toEqual(5);
});
it('has the correct encodedLength for constructor values (u32)', () => {