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

adding functions to get the total flow balance of an account with all… #23

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

bjartek
Copy link
Contributor

@bjartek bjartek commented Nov 15, 2023

turns out finding out the total flow balance for an account with locked companion is very hard. synced with josh and he approves of this.

@crash13override
Copy link

looking good! thanks for the great utility

Copy link

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a test for this somewhere to make sure we're getting everything right?

@bjartek
Copy link
Contributor Author

bjartek commented Nov 15, 2023

Do you have a test for this somewhere to make sure we're getting everything right?

How easy is it to setup and test things using staking/locked token on emulator. Do anybody have a example?

@bjartek
Copy link
Contributor Author

bjartek commented Nov 16, 2023

tests fail because of yet to be released cadence-testing code. We import Crypto. So we have to wait

@joshuahannan
Copy link

No need to test on the emulator. that is a little too complicated to get set up. I just meant testing for an account on testnet or something. Though I could add it to my setup in flow core contracts to make sure it works right on the emulator if you would rather it live there

Copy link

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't deployed anywhere yet, is it?

pub(set) var primaryAcctBalance: UFix64
pub(set) var secondaryAddress: Address?
pub(set) var secondaryAcctBalance: UFix64
pub(set) var stakedBalance: UFix64

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably prefer this to be called nodeStakedBalance just to be consistent on the terminology

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we can do that. Totally forget about this pr.

@bjartek
Copy link
Contributor Author

bjartek commented Dec 15, 2023

I cant get the flow tests to work here, but if i deploy to emulator and run the scripts for the service-account they compile. I have run this code on mainnet for all addresses so i know it works.

Copy link
Contributor

@austinkline austinkline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments but looks good to me 🙂

@joshuahannan
Copy link

yeah, no need to run tests if you have already run a bunch on mainnet to make sure it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants