monorepo icon indicating copy to clipboard operation
monorepo copied to clipboard

[node] return type of RPC method`GetAppInstances` slightly inaccurate

Open ldct opened this issue 5 years ago • 1 comments

The return type is encoded in GetAppInstancesResults, an array of elements of type AppInstanceInfo, whose timeout field is of type BigNumber; however manual examination of the return type at https://github.com/counterfactual/monorepo/blob/master/packages/node/test/integration/get-app-instances.spec.ts#L108 shows that it is of type { _hex: string }. The array elements are also of type Object. Note that expect()...toEqual ignores these differences. This misalignment will allow e.g. RPC consumers to use bignumber methods on the timeout field without being caught by typescript.

ldct avatar Apr 30 '19 06:04 ldct

This task will be to make the type system correctly express the differences, then.

snario avatar May 08 '19 18:05 snario