I am writing some simple contract tests, and I want to check that account balances are updating appropriately.
There is currently no minus method on the Tez type. I attempted to add my own to the module, intending to make a PR if it worked - adding the following method to the Tez class in main.ts of archetype-ts-types...
minus(x: Tez): Tez {
const result = this._content.minus(x.to_big_number())
if (this._content.isLessThan(new BigNumber(0)) || this._content.isGreaterThan(new BigNumber("")))
throw new Error("Invalid Tez value")
return new Tez(result, "mutez")
}
However I simply get the error "Property minus does not exist on type Tez".
Really I have two related questions -
- Why don't my updates to the types library in my local files flow through to my test script?
- Is this the right track or is there actually already a better way of doing this?
(I realise I can add "plus" to the other side of the assert equation, which is what I am doing for now, but it makes it easier to follow the meaning of the tests code having the minus option, so that would handy)
Help appreciated - thanks