import { Bool , BytesReader } from "as-scale-codec" ; import { Serialiser } from "subsembly-core" ; import { Executive } from '../../frame/executive' ; import { BlockType , HeaderType , RuntimeConfig } from '../runtime' ; description param data param len export function Core_version ( data , len ) { const version = RuntimeConfig . runtimeVersion ( ) ; return Serialiser . serialiseResult ( version . toU8a ( ) ) ; } description param data param len export function Core_execute_block ( data , len ) { const input = Serialiser . deserialiseInput ( data , len ) ; const block = BytesReader . decodeInto < BlockType > ( input ) ; Executive . executeBlock ( block ) ; return Serialiser . serialiseResult ( ( new Bool ( true ) ) . toU8a ( ) ) ; } description param data param len export function Core_initialize_block ( data , len ) { const input = Serialiser . deserialiseInput ( data , len ) ; const header = BytesReader . decodeInto < HeaderType > ( input ) ; Executive . initializeBlock ( header ) ; return Serialiser . serialiseResult ( [ ] ) ; }