encode method

  1. @override
List<int> encode(
  1. String value
)
override

Encode the provided value as bytes and wrap it in Substrate SCALE format.

Implementation

@override
List<int> encode(String value) {
  final toBytes = StringUtils.encode(value);
  List<int> lengthBytes =
      const SubstrateScaleCUintEncoder().encode(toBytes.length.toString());
  return List<int>.from([...lengthBytes, ...toBytes]);
}