scale_rb 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +0 -0
- data/examples/http_client_3.rb +84 -0
- data/exe/metadata +1 -1
- data/lib/scale_rb/call_helper.rb +5 -5
- data/lib/scale_rb/client/{client_ext.rb → client_share.rb} +12 -6
- data/lib/scale_rb/client/http_client.rb +2 -2
- data/lib/scale_rb/client/ws_client.rb +2 -2
- data/lib/scale_rb/decode.rb +17 -0
- data/lib/scale_rb/extrinsic_helper.rb +50 -0
- data/lib/scale_rb/metadata/metadata.rb +213 -65
- data/lib/scale_rb/metadata/metadata_v10.rb +40 -40
- data/lib/scale_rb/metadata/metadata_v11.rb +44 -44
- data/lib/scale_rb/metadata/metadata_v12.rb +22 -22
- data/lib/scale_rb/metadata/metadata_v13.rb +45 -45
- data/lib/scale_rb/metadata/metadata_v14.rb +123 -117
- data/lib/scale_rb/metadata/metadata_v9.rb +56 -56
- data/lib/scale_rb/old_registry.rb +552 -0
- data/lib/scale_rb/portable_registry.rb +30 -12
- data/lib/scale_rb/storage_helper.rb +9 -5
- data/lib/scale_rb/types.rb +9 -2
- data/lib/scale_rb/version.rb +1 -1
- data/lib/scale_rb.rb +3 -1
- metadata +7 -6
- data/lib/scale_rb/metadata/registry.rb +0 -263
- data/lib/scale_rb/metadata/type_exp.rb +0 -286
@@ -4,54 +4,54 @@ module ScaleRb
|
|
4
4
|
module Metadata
|
5
5
|
module MetadataV10
|
6
6
|
TYPES = {
|
7
|
-
ErrorMetadataV10
|
8
|
-
EventMetadataV10
|
9
|
-
FunctionArgumentMetadataV10
|
10
|
-
FunctionMetadataV10
|
11
|
-
MetadataV10
|
12
|
-
modules
|
7
|
+
'ErrorMetadataV10' => 'ErrorMetadataV9',
|
8
|
+
'EventMetadataV10' => 'EventMetadataV9',
|
9
|
+
'FunctionArgumentMetadataV10' => 'FunctionArgumentMetadataV9',
|
10
|
+
'FunctionMetadataV10' => 'FunctionMetadataV9',
|
11
|
+
'MetadataV10' => {
|
12
|
+
'modules' => 'Vec<ModuleMetadataV10>'
|
13
13
|
},
|
14
|
-
ModuleConstantMetadataV10
|
15
|
-
ModuleMetadataV10
|
16
|
-
name
|
17
|
-
storage
|
18
|
-
calls
|
19
|
-
events
|
20
|
-
constants
|
21
|
-
errors
|
14
|
+
'ModuleConstantMetadataV10' => 'ModuleConstantMetadataV9',
|
15
|
+
'ModuleMetadataV10' => {
|
16
|
+
'name' => 'Text',
|
17
|
+
'storage' => 'Option<StorageMetadataV10>',
|
18
|
+
'calls' => 'Option<Vec<FunctionMetadataV10>>',
|
19
|
+
'events' => 'Option<Vec<EventMetadataV10>>',
|
20
|
+
'constants' => 'Vec<ModuleConstantMetadataV10>',
|
21
|
+
'errors' => 'Vec<ErrorMetadataV10>'
|
22
22
|
},
|
23
|
-
StorageEntryModifierV10
|
24
|
-
StorageEntryMetadataV10
|
25
|
-
name
|
26
|
-
modifier
|
27
|
-
type
|
28
|
-
fallback
|
29
|
-
docs
|
23
|
+
'StorageEntryModifierV10' => 'StorageEntryModifierV9',
|
24
|
+
'StorageEntryMetadataV10' => {
|
25
|
+
'name' => 'Text',
|
26
|
+
'modifier' => 'StorageEntryModifierV10',
|
27
|
+
'type' => 'StorageEntryTypeV10',
|
28
|
+
'fallback' => 'Bytes',
|
29
|
+
'docs' => 'Vec<Text>'
|
30
30
|
},
|
31
|
-
StorageEntryTypeV10
|
32
|
-
_enum
|
33
|
-
Plain
|
34
|
-
Map
|
35
|
-
hasher
|
36
|
-
key
|
37
|
-
value
|
38
|
-
linked
|
31
|
+
'StorageEntryTypeV10' => {
|
32
|
+
'_enum' => {
|
33
|
+
'Plain' => 'Type',
|
34
|
+
'Map' => {
|
35
|
+
'hasher' => 'StorageHasherV10',
|
36
|
+
'key' => 'Type',
|
37
|
+
'value' => 'Type',
|
38
|
+
'linked' => 'bool'
|
39
39
|
},
|
40
|
-
DoubleMap
|
41
|
-
hasher
|
42
|
-
key1
|
43
|
-
key2
|
44
|
-
value
|
45
|
-
key2Hasher
|
40
|
+
'DoubleMap' => {
|
41
|
+
'hasher' => 'StorageHasherV10',
|
42
|
+
'key1' => 'Type',
|
43
|
+
'key2' => 'Type',
|
44
|
+
'value' => 'Type',
|
45
|
+
'key2Hasher' => 'StorageHasherV10'
|
46
46
|
}
|
47
47
|
}
|
48
48
|
},
|
49
|
-
StorageMetadataV10
|
50
|
-
prefix
|
51
|
-
items
|
49
|
+
'StorageMetadataV10' => {
|
50
|
+
'prefix' => 'Text',
|
51
|
+
'items' => 'Vec<StorageEntryMetadataV10>'
|
52
52
|
},
|
53
|
-
StorageHasherV10
|
54
|
-
_enum
|
53
|
+
'StorageHasherV10' => {
|
54
|
+
'_enum' => %w[
|
55
55
|
Blake2_128
|
56
56
|
Blake2_256
|
57
57
|
Blake2_128Concat
|
@@ -4,59 +4,59 @@ module ScaleRb
|
|
4
4
|
module Metadata
|
5
5
|
module MetadataV11
|
6
6
|
TYPES = {
|
7
|
-
ErrorMetadataV11
|
8
|
-
EventMetadataV11
|
9
|
-
ExtrinsicMetadataV11
|
10
|
-
version
|
11
|
-
signedExtensions
|
7
|
+
'ErrorMetadataV11' => 'ErrorMetadataV10',
|
8
|
+
'EventMetadataV11' => 'EventMetadataV10',
|
9
|
+
'ExtrinsicMetadataV11' => {
|
10
|
+
'version' => 'u8',
|
11
|
+
'signedExtensions' => 'Vec<Text>'
|
12
12
|
},
|
13
|
-
FunctionArgumentMetadataV11
|
14
|
-
FunctionMetadataV11
|
15
|
-
MetadataV11
|
16
|
-
modules
|
17
|
-
extrinsic
|
13
|
+
'FunctionArgumentMetadataV11' => 'FunctionArgumentMetadataV10',
|
14
|
+
'FunctionMetadataV11' => 'FunctionMetadataV10',
|
15
|
+
'MetadataV11' => {
|
16
|
+
'modules' => 'Vec<ModuleMetadataV11>',
|
17
|
+
'extrinsic' => 'ExtrinsicMetadataV11'
|
18
18
|
},
|
19
|
-
ModuleConstantMetadataV11
|
20
|
-
ModuleMetadataV11
|
21
|
-
name
|
22
|
-
storage
|
23
|
-
calls
|
24
|
-
events
|
25
|
-
constants
|
26
|
-
errors
|
19
|
+
'ModuleConstantMetadataV11' => 'ModuleConstantMetadataV10',
|
20
|
+
'ModuleMetadataV11' => {
|
21
|
+
'name' => 'Text',
|
22
|
+
'storage' => 'Option<StorageMetadataV11>',
|
23
|
+
'calls' => 'Option<Vec<FunctionMetadataV11>>',
|
24
|
+
'events' => 'Option<Vec<EventMetadataV11>>',
|
25
|
+
'constants' => 'Vec<ModuleConstantMetadataV11>',
|
26
|
+
'errors' => 'Vec<ErrorMetadataV11>'
|
27
27
|
},
|
28
|
-
StorageEntryModifierV11
|
29
|
-
StorageEntryMetadataV11
|
30
|
-
name
|
31
|
-
modifier
|
32
|
-
type
|
33
|
-
fallback
|
34
|
-
docs
|
28
|
+
'StorageEntryModifierV11' => 'StorageEntryModifierV10',
|
29
|
+
'StorageEntryMetadataV11' => {
|
30
|
+
'name' => 'Text',
|
31
|
+
'modifier' => 'StorageEntryModifierV11',
|
32
|
+
'type' => 'StorageEntryTypeV11',
|
33
|
+
'fallback' => 'Bytes',
|
34
|
+
'docs' => 'Vec<Text>'
|
35
35
|
},
|
36
|
-
StorageEntryTypeV11
|
37
|
-
_enum
|
38
|
-
Plain
|
39
|
-
Map
|
40
|
-
hasher
|
41
|
-
key
|
42
|
-
value
|
43
|
-
linked
|
36
|
+
'StorageEntryTypeV11' => {
|
37
|
+
'_enum' => {
|
38
|
+
'Plain' => 'Type',
|
39
|
+
'Map' => {
|
40
|
+
'hasher' => 'StorageHasherV11',
|
41
|
+
'key' => 'Type',
|
42
|
+
'value' => 'Type',
|
43
|
+
'linked' => 'bool'
|
44
44
|
},
|
45
|
-
DoubleMap
|
46
|
-
hasher
|
47
|
-
key1
|
48
|
-
key2
|
49
|
-
value
|
50
|
-
key2Hasher
|
45
|
+
'DoubleMap' => {
|
46
|
+
'hasher' => 'StorageHasherV11',
|
47
|
+
'key1' => 'Type',
|
48
|
+
'key2' => 'Type',
|
49
|
+
'value' => 'Type',
|
50
|
+
'key2Hasher' => 'StorageHasherV11'
|
51
51
|
}
|
52
52
|
}
|
53
53
|
},
|
54
|
-
StorageMetadataV11
|
55
|
-
prefix
|
56
|
-
items
|
54
|
+
'StorageMetadataV11' => {
|
55
|
+
'prefix' => 'Text',
|
56
|
+
'items' => 'Vec<StorageEntryMetadataV11>'
|
57
57
|
},
|
58
|
-
StorageHasherV11
|
59
|
-
_enum
|
58
|
+
'StorageHasherV11' => {
|
59
|
+
'_enum' => %w[
|
60
60
|
Blake2_128
|
61
61
|
Blake2_256
|
62
62
|
Blake2_128Concat
|
@@ -4,30 +4,30 @@ module ScaleRb
|
|
4
4
|
module Metadata
|
5
5
|
module MetadataV12
|
6
6
|
TYPES = {
|
7
|
-
ErrorMetadataV12
|
8
|
-
EventMetadataV12
|
9
|
-
ExtrinsicMetadataV12
|
10
|
-
FunctionArgumentMetadataV12
|
11
|
-
FunctionMetadataV12
|
12
|
-
MetadataV12
|
13
|
-
modules
|
14
|
-
extrinsic
|
7
|
+
'ErrorMetadataV12' => 'ErrorMetadataV11',
|
8
|
+
'EventMetadataV12' => 'EventMetadataV11',
|
9
|
+
'ExtrinsicMetadataV12' => 'ExtrinsicMetadataV11',
|
10
|
+
'FunctionArgumentMetadataV12' => 'FunctionArgumentMetadataV11',
|
11
|
+
'FunctionMetadataV12' => 'FunctionMetadataV11',
|
12
|
+
'MetadataV12' => {
|
13
|
+
'modules' => 'Vec<ModuleMetadataV12>',
|
14
|
+
'extrinsic' => 'ExtrinsicMetadataV12'
|
15
15
|
},
|
16
|
-
ModuleConstantMetadataV12
|
17
|
-
ModuleMetadataV12
|
18
|
-
name
|
19
|
-
storage
|
20
|
-
calls
|
21
|
-
events
|
22
|
-
constants
|
23
|
-
errors
|
24
|
-
index
|
16
|
+
'ModuleConstantMetadataV12' => 'ModuleConstantMetadataV11',
|
17
|
+
'ModuleMetadataV12' => {
|
18
|
+
'name' => 'Text',
|
19
|
+
'storage' => 'Option<StorageMetadataV12>',
|
20
|
+
'calls' => 'Option<Vec<FunctionMetadataV12>>',
|
21
|
+
'events' => 'Option<Vec<EventMetadataV12>>',
|
22
|
+
'constants' => 'Vec<ModuleConstantMetadataV12>',
|
23
|
+
'errors' => 'Vec<ErrorMetadataV12>',
|
24
|
+
'index' => 'u8'
|
25
25
|
},
|
26
|
-
StorageEntryModifierV12
|
27
|
-
StorageEntryMetadataV12
|
28
|
-
StorageEntryTypeV12
|
29
|
-
StorageMetadataV12
|
30
|
-
StorageHasherV12
|
26
|
+
'StorageEntryModifierV12' => 'StorageEntryModifierV11',
|
27
|
+
'StorageEntryMetadataV12' => 'StorageEntryMetadataV11',
|
28
|
+
'StorageEntryTypeV12' => 'StorageEntryTypeV11',
|
29
|
+
'StorageMetadataV12' => 'StorageMetadataV11',
|
30
|
+
'StorageHasherV12' => 'StorageHasherV11'
|
31
31
|
}.freeze
|
32
32
|
end
|
33
33
|
end
|
@@ -4,61 +4,61 @@ module ScaleRb
|
|
4
4
|
module Metadata
|
5
5
|
module MetadataV13
|
6
6
|
TYPES = {
|
7
|
-
MetadataV13
|
8
|
-
modules
|
9
|
-
extrinsic
|
7
|
+
'MetadataV13' => {
|
8
|
+
'modules' => 'Vec<ModuleMetadataV13>',
|
9
|
+
'extrinsic' => 'ExtrinsicMetadataV13'
|
10
10
|
},
|
11
11
|
|
12
|
-
ModuleMetadataV13
|
13
|
-
name
|
14
|
-
storage
|
15
|
-
calls
|
16
|
-
events
|
17
|
-
constants
|
18
|
-
errors
|
19
|
-
index
|
12
|
+
'ModuleMetadataV13' => {
|
13
|
+
'name' => 'Text',
|
14
|
+
'storage' => 'Option<StorageMetadataV13>',
|
15
|
+
'calls' => 'Option<Vec<FunctionMetadataV13>>',
|
16
|
+
'events' => 'Option<Vec<EventMetadataV13>>',
|
17
|
+
'constants' => 'Vec<ModuleConstantMetadataV13>',
|
18
|
+
'errors' => 'Vec<ErrorMetadataV13>',
|
19
|
+
'index' => 'u8'
|
20
20
|
},
|
21
|
-
StorageMetadataV13
|
22
|
-
prefix
|
23
|
-
items
|
21
|
+
'StorageMetadataV13' => {
|
22
|
+
'prefix' => 'Text',
|
23
|
+
'items' => 'Vec<StorageEntryMetadataV13>'
|
24
24
|
},
|
25
|
-
StorageEntryMetadataV13
|
26
|
-
name
|
27
|
-
modifier
|
28
|
-
type
|
29
|
-
fallback
|
30
|
-
docs
|
25
|
+
'StorageEntryMetadataV13' => {
|
26
|
+
'name' => 'Text',
|
27
|
+
'modifier' => 'StorageEntryModifierV13',
|
28
|
+
'type' => 'StorageEntryTypeV13',
|
29
|
+
'fallback' => 'Bytes',
|
30
|
+
'docs' => 'Vec<Text>'
|
31
31
|
},
|
32
|
-
StorageEntryModifierV13
|
33
|
-
StorageEntryTypeV13
|
34
|
-
_enum
|
35
|
-
plain
|
36
|
-
map
|
37
|
-
hasher
|
38
|
-
key
|
39
|
-
value
|
40
|
-
linked
|
32
|
+
'StorageEntryModifierV13' => 'StorageEntryModifierV12',
|
33
|
+
'StorageEntryTypeV13' => {
|
34
|
+
'_enum' => {
|
35
|
+
'plain' => 'Type',
|
36
|
+
'map' => {
|
37
|
+
'hasher' => 'StorageHasherV13',
|
38
|
+
'key' => 'Type',
|
39
|
+
'value' => 'Type',
|
40
|
+
'linked' => 'bool'
|
41
41
|
},
|
42
|
-
doubleMap
|
43
|
-
hasher
|
44
|
-
key1
|
45
|
-
key2
|
46
|
-
value
|
47
|
-
key2Hasher
|
42
|
+
'doubleMap' => {
|
43
|
+
'hasher' => 'StorageHasherV13',
|
44
|
+
'key1' => 'Type',
|
45
|
+
'key2' => 'Type',
|
46
|
+
'value' => 'Type',
|
47
|
+
'key2Hasher' => 'StorageHasherV13'
|
48
48
|
},
|
49
|
-
nMap
|
50
|
-
keyVec
|
51
|
-
hashers
|
52
|
-
value
|
49
|
+
'nMap' => {
|
50
|
+
'keyVec' => 'Vec<Type>',
|
51
|
+
'hashers' => 'Vec<StorageHasherV13>',
|
52
|
+
'value' => 'Type'
|
53
53
|
}
|
54
54
|
}
|
55
55
|
},
|
56
|
-
StorageHasherV13
|
57
|
-
FunctionMetadataV13
|
58
|
-
EventMetadataV13
|
59
|
-
ModuleConstantMetadataV13
|
60
|
-
ErrorMetadataV13
|
61
|
-
ExtrinsicMetadataV13
|
56
|
+
'StorageHasherV13' => 'StorageHasherV12',
|
57
|
+
'FunctionMetadataV13' => 'FunctionMetadataV12',
|
58
|
+
'EventMetadataV13' => 'EventMetadataV12',
|
59
|
+
'ModuleConstantMetadataV13' => 'ModuleConstantMetadataV12',
|
60
|
+
'ErrorMetadataV13' => 'ErrorMetadataV12',
|
61
|
+
'ExtrinsicMetadataV13' => 'ExtrinsicMetadataV12'
|
62
62
|
}.freeze
|
63
63
|
end
|
64
64
|
end
|