Fix c-like enums type encoding (#2703)

* Fix c-like enums type encoding

* Update packages/api-contract/src/ContractRegistry.ts

* Update packages/types/src/codec/utils/encodeTypes.ts
This commit is contained in:
Jaco Greeff
2020-10-11 09:25:44 +02:00
committed by GitHub
parent 5b42bc9a22
commit 43791bcc71
5 changed files with 25 additions and 30 deletions
@@ -169,7 +169,7 @@
"type": "Null"
}
],
"type": "[\"NameAlreadyExists\", \"CallerIsNotOwner\"]"
"type": "{ _enum: [\"NameAlreadyExists\", \"CallerIsNotOwner\"] }"
}
],
"info": 7,
@@ -203,7 +203,7 @@
"type": "Null"
}
],
"type": "[\"NameAlreadyExists\", \"CallerIsNotOwner\"]"
"type": "{ _enum: [\"NameAlreadyExists\", \"CallerIsNotOwner\"] }"
}
],
"type": "Result<(), Error>"
@@ -235,7 +235,7 @@
"type": "Null"
}
],
"type": "[\"NameAlreadyExists\", \"CallerIsNotOwner\"]"
"type": "{ _enum: [\"NameAlreadyExists\", \"CallerIsNotOwner\"] }"
},
{
"displayName": "Option",
@@ -404,7 +404,7 @@
"type": "Null"
}
],
"type": "[\"NotOwner\", \"NotApproved\", \"TokenExists\", \"TokenNotFound\", \"CannotInsert\", \"CannotRemove\", \"CannotFetchValue\", \"NotAllowed\"]"
"type": "{ _enum: [\"NotOwner\", \"NotApproved\", \"TokenExists\", \"TokenNotFound\", \"CannotInsert\", \"CannotRemove\", \"CannotFetchValue\", \"NotAllowed\"] }"
}
],
"info": 7,
@@ -486,7 +486,7 @@
"type": "Null"
}
],
"type": "[\"NotOwner\", \"NotApproved\", \"TokenExists\", \"TokenNotFound\", \"CannotInsert\", \"CannotRemove\", \"CannotFetchValue\", \"NotAllowed\"]"
"type": "{ _enum: [\"NotOwner\", \"NotApproved\", \"TokenExists\", \"TokenNotFound\", \"CannotInsert\", \"CannotRemove\", \"CannotFetchValue\", \"NotAllowed\"] }"
}
],
"type": "Result<(), Error>"
@@ -566,6 +566,6 @@
"type": "Null"
}
],
"type": "[\"NotOwner\", \"NotApproved\", \"TokenExists\", \"TokenNotFound\", \"CannotInsert\", \"CannotRemove\", \"CannotFetchValue\", \"NotAllowed\"]"
"type": "{ _enum: [\"NotOwner\", \"NotApproved\", \"TokenExists\", \"TokenNotFound\", \"CannotInsert\", \"CannotRemove\", \"CannotFetchValue\", \"NotAllowed\"] }"
}
]