Closed damianlluch closed 3 years ago
Truffle-assertions only helps with specific functionality that is difficult to test without it (like events and reverts). What you want to test is possible with just the regular Truffle test framework. Your suggested methods work. You probably want to check that the balance of the user has decreased by X and the balance of address(0) has increased by X.
If you want to knowhow to do that specifically, you can check out some Truffle guides online or look at the Ethereum StackExchange, but it is out of scope for the truffle-assertions library.
One additional check you can do with truffle-assertions is check that a Transfer
event has been emitted with the expected values (from user to address(0) with amount X).
Hello, I am developing my first contract professionally. I am using truffle assertions. I have doubts about how to test that a token is burnt. I understand that one option would be to verify that the owner of the token is address 0. How do I do this with truffle assertions? do I need to install another library? Another option would be to check the balance of the user or the burned token. But this is not clear to me. If someone can tell me how to do it with truffle assertions. Thanks