stacks-network / clarity-wasm

`clar2wasm` is a compiler for generating WebAssembly from Clarity.
GNU General Public License v3.0
12 stars 9 forks source link

Improve unit tests coverage for stx-transfer-memo? function #401

Open csgui opened 1 month ago

csgui commented 1 month ago

Cover unhappy path of stx-transfer-memo? function with unit tests.

https://github.com/stacks-network/clarity-wasm/blob/main/clar2wasm/src/words/stx.rs#L131

Acaccia commented 1 month ago

stx-transfer-memo? and stx-transfer both use the exact same stdlib.transfer-memo wasm function. Current unit tests already cover the unhappy paths.

csgui commented 1 month ago

Just noticed that. Thanks for pointing @Acaccia ! 👍

https://github.com/stacks-network/clarity-wasm/blob/main/clar2wasm/src/words/stx.rs#L75

https://github.com/stacks-network/clarity-wasm/blob/main/clar2wasm/src/words/stx.rs#L105

Closing this issue as it is no longer necessary.

Acaccia commented 1 month ago

My comment was not necessarily about this issue being unnecessary, but it was more the fact that the current tests could be copied for stx-transfer-memo?.

I think it's important to add them in case we refactor those functions later, so I'll reopen this issue.

csgui commented 1 month ago

I think it's important to add them in case we refactor those functions later, so I'll reopen this issue.

Oh, I see! I misunderstood your comment. Thanks!