aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

feat: expose more BCS helpers

Open jjleng opened this issue 3 years ago • 2 comments

Description

Add more BCS helpers and expose them. This would simplify the usage of BCS. e.g.

  const serializer = new Serializer();
  serializer.serializeU32(123);
  const bytes = serializer.getBytes();

can be reduced to const bytes = bcsSerializeU32(123);

Test Plan

Added unit tests


This change is Reviewable

jjleng avatar Jul 30 '22 01:07 jjleng

Are there deserialize matching functions too?

These bcsSerializeXXXX are used when submitting transactions. We can add some deserialization helpers if needed when we deserialize the payloads from Daniel's new BCS endpoints.

jjleng avatar Jul 30 '22 05:07 jjleng

:white_check_mark: Forge test success on 3009de26a44767cf8c59f90baac564df70c3067f

all up : 4958 TPS, 2223 ms latency, 3000 ms p99 latency,no expired txns

github-actions[bot] avatar Jul 30 '22 23:07 github-actions[bot]