Inject index properly into ReferendumInfo (with unwrap) (#718)

* Inject inject properly into ReferendumInfo (with unwrap)

* Use unwrapOr

* Fix type import
This commit is contained in:
Jaco Greeff
2019-02-19 15:20:45 +01:00
committed by GitHub
parent f57a6b1533
commit f820dfcffa
2 changed files with 16 additions and 13 deletions
+4 -2
View File
@@ -2,8 +2,10 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import BlockNumber from './BlockNumber';
import { Codec } from '../types';
import Struct from '../codec/Struct';
import BlockNumber from './BlockNumber';
import Proposal from './Proposal';
import VoteThreshold from './VoteThreshold';
@@ -20,7 +22,7 @@ type ReferendumInfoValue = {
* Info regarding an ongoing referendum
*/
export default class ReferendumInfo extends Struct {
constructor (value?: ReferendumInfoValue | Uint8Array) {
constructor (value?: ReferendumInfoValue | Uint8Array | Map<string, Codec>) {
super({
end: BlockNumber,
proposal: Proposal,