Skip to content

Comments

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

Open
bjartek wants to merge 22 commits intomainfrom
FlowUtils
Open

adding functions to get the total flow balance of an account with all…#23
bjartek wants to merge 22 commits intomainfrom
FlowUtils

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 and others added 12 commits November 16, 2023 00:02
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
Co-authored-by: Joshua Hannan <joshua.hannan@dapperlabs.com>
@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