nearprotocol / near-runtime-ts

Typescript library for writing near smart contracts
22 stars 7 forks source link

Use near-lib with as-pect and add mocked backed #104

Open willemneal opened 4 years ago

willemneal commented 4 years ago

Ideally we can use as-pect with near-lib. Currently the as-pect tests we use are to test encoding/decoding and mock the imported functions. If we add near-lib we can do the compiling and testing all in one step instead of two.

One issue that might arise is that currently as-pect binaries contain exported functions that use floating point numbers. Is it the case that any floats in a binary case issues with the nearcore?

The other feature that will be useful in NEARStudio and in general is to properly mock near-lib such that a connection to a node isn't required. Or I should say a "real" node. Perhaps in the web context it's another web worker.

bowenwang1996 commented 4 years ago

You cannot have floats in the binary.