Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gno test]: default realm balance in tests #2595

Open
agherasie opened this issue Jul 16, 2024 · 1 comment
Open

[gno test]: default realm balance in tests #2595

agherasie opened this issue Jul 16, 2024 · 1 comment

Comments

@agherasie
Copy link
Contributor

Description

I tried to write tests for disperse but I ran into a problem concerning the realm's balance in the testing scope.
There is a set amount of balance for every realm only in testing scope, which makes it difficult to test some functions using gno test. @leohhhn suggested I use txtar tests instead which I did, but I'm not sure why the tests work this way, and if there is a way / plan to change this in the future

The disperse project aims to port the existing disperse ethereum app to gno

image

There is a part of the code which checks the contract's balance to send back the leftover amount if it exists

In the gno test scope, this doesn't work because the realm already has an existing balance

@leohhhn
Copy link
Contributor

leohhhn commented Jul 17, 2024

cc @thehowl

leohhhn added a commit that referenced this issue Aug 21, 2024
This PR adds a gno version of the [disperse ethereum
app](https://disperse.app/) to gno.land !
Another attempt was made in #1414 but
we have decided to pick up from @leohhhn 's work with @lennyvong and
made this PR, tested using txtar tests to avoid the situation described
in #2595
There is also an older (but functional for the most part) version
[deployed in
test4](https://test4.gno.land/r/g1w62226g8hykfmtuasvz80rdf0jl6phgxsphh5v/testing/disperse2?help)
with a linked [webapp](https://gno-disperse.netlify.app/)

<img width="649" alt="image"
src="https://github.com/user-attachments/assets/ad26a1a9-0447-4333-858a-253441c457ba">

<details><summary>Contributors' checklist...</summary>

- [X] Added new tests, or not needed, or not feasible
- [X] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [X] Updated the official documentation or not needed
- [X] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [X] Added references to related issues and PRs
- [X] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: leohhhn <hudakleon@gmail.com>
Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
Co-authored-by: lennyvongphouthone <lenny.vongphouthone@epitech.eu>
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Status: Triage
Development

No branches or pull requests

2 participants