@stellar-expert/contract-wasm-interface-parser 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/xdr-reader.js +0 -3
- package/src/xdr-spec-parser.js +3 -3
package/package.json
CHANGED
package/src/xdr-reader.js
CHANGED
|
@@ -72,7 +72,6 @@ export class XdrReader {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Reset reader position
|
|
75
|
-
* @return {void}
|
|
76
75
|
*/
|
|
77
76
|
rewind() {
|
|
78
77
|
this._index = 0
|
|
@@ -138,8 +137,6 @@ export class XdrReader {
|
|
|
138
137
|
|
|
139
138
|
/**
|
|
140
139
|
* Ensure that input buffer has been consumed in full, otherwise it's a type mismatch
|
|
141
|
-
* @return {void}
|
|
142
|
-
* @throws {Error}
|
|
143
140
|
*/
|
|
144
141
|
ensureInputConsumed() {
|
|
145
142
|
if (this._index !== this._length)
|
package/src/xdr-spec-parser.js
CHANGED
|
@@ -47,7 +47,7 @@ export function parseSpec(entries) {
|
|
|
47
47
|
name: parseStructName(value),
|
|
48
48
|
cases: value.cases().reduce((agg, c) => {
|
|
49
49
|
const value = c.value()
|
|
50
|
-
agg[value.name().toString()] = value.type ? value.type().map(parseParameterType) :
|
|
50
|
+
agg[value.name().toString()] = value.type ? value.type().map(parseParameterType) : []
|
|
51
51
|
return agg
|
|
52
52
|
}, {})
|
|
53
53
|
})
|
|
@@ -95,9 +95,9 @@ function parseParameterType(type) {
|
|
|
95
95
|
case 'scSpecTypeVec':
|
|
96
96
|
return `vec<${parseParameterType(type.value().elementType())}>`
|
|
97
97
|
case 'scSpecTypeMap':
|
|
98
|
-
return `map<${parseParameterType(type.value().keyType())},${
|
|
98
|
+
return `map<${parseParameterType(type.value().keyType())},${parseParameterType(type.value().valueType())}>`
|
|
99
99
|
case 'scSpecTypeResult':
|
|
100
|
-
return `result<${parseParameterType(type.value().okType())},${
|
|
100
|
+
return `result<${parseParameterType(type.value().okType())},${parseParameterType(type.value().errorType())}>`
|
|
101
101
|
case 'scSpecTypeTuple':
|
|
102
102
|
return `tuple<${type.value().valueTypes().map(parseParameterType).join()}>`
|
|
103
103
|
case 'scSpecTypeUdt':
|