DoubleMap extended tests (#1179)

* DoubleMap extended tests

* TwoX64Concat test (aligned with Rust)

* Remove .only

* Update Type.ts

* And working

* Check the full JSON output for the keys (future-proof)

* Renames
This commit is contained in:
Jaco Greeff
2019-07-24 16:04:55 +02:00
committed by GitHub
parent e15db8aed9
commit 48159cfb5a
7 changed files with 83 additions and 10 deletions
@@ -1483,7 +1483,7 @@
"constants": [
{
"name": "DEDUP_KEY_PREFIX",
"type": "Bytes",
"type": "Data",
"value": "0x343a73657373696f6e3a6b657973",
"documentation": [
" Used as first key for `NextKeys` and `KeyOwner` to put all the data into the same branch",
+1 -1
View File
@@ -92,7 +92,7 @@ export default class U8a extends Uint8Array implements Codec {
* @description Returns the base runtime type name for this instance
*/
public toRawType (): string {
return `Vec<u8>`;
return `&[u8]`;
}
/**
-6
View File
@@ -10,10 +10,4 @@ import U8a from '../codec/U8a';
* A raw data structure. It is just an encoding of a U8a, without any length encoding
*/
export default class Data extends U8a {
/**
* @description Returns the base runtime type name for this instance
*/
public toRawType (): string {
return 'Data';
}
}
+2 -2
View File
@@ -57,8 +57,8 @@ export default class Type extends Text {
Type._alias('Compact<Index>', 'IndexCompact'),
// alias Vec<u8> -> Bytes
Type._alias('Vec<u8>', 'Bytes'),
// alias &[u8] -> Bytes
Type._alias('&\\[u8\\]', 'Bytes'),
// alias &[u8] -> Data (this has no length-prefix)
Type._alias('&\\[u8\\]', 'Data'),
// alias RawAddress -> Address
Type._alias('RawAddress', 'Address'),
// alias Lookup::Source to Address (_could_ be AccountId on certain chains)