author liangqin.fan gmail import { Int8 , PackedStorableMap , ScaleString , UInt128 } from "ask-lang" ; @ storage class MapTypes { @ packed i8i8Map : PackedStorableMap < Int8 , Int8 > ; @ packed strstrMap : PackedStorableMap < ScaleString , ScaleString > ; @ packed stru128Map : PackedStorableMap < ScaleString , UInt128 > ; @ packed u128strMap : PackedStorableMap < UInt128 , ScaleString > ; } @ contract class MapUsages { protected map : MapTypes ; constructor ( ) { this . map = new MapTypes ( ) ; } @ message set ( key , value ) { this . map . i8i8Map . set ( new Int8 ( key ) , new Int8 ( value ) ) ; } @ message ( mutates = false ) get ( key ) { return this . map . i8i8Map . get ( new Int8 ( key ) ) . unwrap ( ) ; } @ message remove ( key ) { return this . map . i8i8Map . delete ( new Int8 ( key ) ) ; } }