import { ByteArray , BytesReader } from 'as-scale-codec' ; import { InherentData , Storage , Utils } from "subsembly-core" ; import { Moment , TimestampConfig } from '../../runtime/runtime' ; /**
 * Storage entries for Aura module
 */ export namespace AuraStorageEntries { } ; description export class Aura { public static readonly INHERENT_IDENTIFIER : string = "auraslot" ; description static _getSlotDuration ( ) { return TimestampConfig . minimumPeriod ( ) ; } description static _getAuthorities ( ) { const authorities = Storage . get ( Utils . getHashedKey ( "Aura" , "Authorities" , null ) ) ; return authorities . isSome ( ) ? ( < ByteArray > authorities . unwrap ( ) ) . unwrap ( ) : [ ] ; } description param auths static _setAuthorities ( auths ) { Storage . set ( Utils . getHashedKey ( "Aura" , "Authorities" , null ) , auths ) ; } description param data static _createInherent ( data ) { return [ ] ; } description param t param data static _checkInherent ( t , data ) { const auraSlot = Aura . _extractAuraInherentData ( data ) ; const timestampBasedSlot = instantiate < Moment > ( t . unwrap ( ) / Aura . _getSlotDuration ( ) . unwrap ( ) ) ; if ( timestampBasedSlot == auraSlot ) { return true ; } else { return false ; } } description param inhData static _extractAuraInherentData ( inhData ) { const value = inhData . getData ( ) . get ( Aura . INHERENT_IDENTIFIER ) ; return BytesReader . decodeInto < Moment > ( value . unwrap ( ) ) ; } }