(
mainScriptHash: string,
root: BlockNode,
appLogo: AppLogo | null = null
)
| 183 | } |
| 184 | |
| 185 | public constructor( |
| 186 | mainScriptHash: string, |
| 187 | root: BlockNode, |
| 188 | appLogo: AppLogo | null = null |
| 189 | ) { |
| 190 | this.mainScriptHash = mainScriptHash |
| 191 | this.root = root |
| 192 | this.appLogo = appLogo |
| 193 | |
| 194 | // Verify that our root node has exactly 4 children: a 'main' block, |
| 195 | // a 'sidebar' block, a `bottom` block and an 'event' block. |
| 196 | if ( |
| 197 | this.root.children.length !== 4 || |
| 198 | isNullOrUndefined(this.main) || |
| 199 | isNullOrUndefined(this.sidebar) || |
| 200 | isNullOrUndefined(this.event) || |
| 201 | isNullOrUndefined(this.bottom) |
| 202 | ) { |
| 203 | throw new Error(`Invalid root node children! ${root.debug()}`) |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | public get main(): BlockNode { |
| 208 | const [main] = this.root.children |
nothing calls this directly
no test coverage detected