Contracts with Data return (#1540)

* Contracts with Data return

* Data toU8a()
This commit is contained in:
Jaco Greeff
2019-11-03 17:15:21 +01:00
committed by GitHub
parent 7c04be6abc
commit 287ceb2ded
4 changed files with 13 additions and 12 deletions
@@ -69,8 +69,11 @@ export default class Contract<ApiType extends ApiTypes> extends BaseWithTxAndRpc
private createOutcome (result: ContractExecResult, origin: AccountId, message: ContractABIMessage, params: any[]): ContractCallOutcome {
let output: string;
if (result.isSuccess) {
const { data } = result.asSuccess;
// TODO We actually want to return the full Codec type here, not a string value
output = message.returnType
? formatData(data, message.returnType).toString()
: data.toHex();