serializeArgInner function
Implementation
void serializeArgInner(dynamic argVal, TypeTag argType, Serializer serializer, int depth) {
if (argType is TypeTagBool) {
serializer.serializeBool(ensureBoolean(argVal));
} else if (argType is TypeTagU8) {
serializer.serializeU8(ensureNumber(argVal));
} else if (argType is TypeTagU16) {
serializer.serializeU16(ensureNumber(argVal));
} else if (argType is TypeTagU32) {
serializer.serializeU32(ensureNumber(argVal));
} else if (argType is TypeTagU64) {
serializer.serializeU64(ensureBigInt(argVal));
} else if (argType is TypeTagU128) {
serializer.serializeU128(ensureBigInt(argVal));
} else if (argType is TypeTagU256) {
serializer.serializeU256(ensureBigInt(argVal));
} else if (argType is TypeTagAddress) {
_serializeAddress(argVal, serializer);
} else if (argType is TypeTagVector) {
_serializeVector(argVal, argType, serializer, depth);
} else if (argType is TypeTagStruct) {
_serializeStruct(argVal, argType, serializer, depth);
} else {
throw ArgumentError("Unsupported arg type.");
}
}