Closed kevsul closed 3 years ago
leaning towards option 1. also since passing an unsafe integer doesn't give the most descriptive error message when integer validation fails.
should also test this behavior on childchain.sendTransaction
as thats the other one that accepts the payments object.
we may also want to only accept BN across our entire api to reduce confusion of these multiple types, ie the rootchain module and transaction helpers
I'm supportive of 1, it's easier to document.
However, if we do decide to stick with 2, perhaps something like property based testing could protect us from issues like this one across our APIs in the future?
Childchain.createTransaction() allows you to pass
payment.amount
as a string or a number, but it will fail in the Watcher if it's a string.E.g. this fails
but this succeeds
The solution is to either
payment.amount