Fix outputs in Contract Constant Queries (#4953)
This commit is contained in:
committed by
Gav Wood
parent
4ebd597354
commit
c009a289d5
@@ -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;
|
||||
}, {});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user