Fix outputs in Contract Constant Queries (#4953)

This commit is contained in:
Nicolas Gotchac
2017-03-19 08:52:14 +01:00
committed by Gav Wood
parent 4ebd597354
commit c009a289d5
2 changed files with 43 additions and 17 deletions

View File

@@ -363,12 +363,15 @@ class Contract extends Component {
.filter((fn) => !fn.inputs.length);
Promise
.all(queries.map((query) => query.call()))
.all(queries.map((query) => query.call({ rawTokens: true })))
.then(results => {
const values = queries.reduce((object, fn, idx) => {
const key = fn.name;
object[key] = results[idx];
object[key] = fn.outputs.length === 1
? [ results[idx] ]
: results[idx];
return object;
}, {});