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

Feature/pay cpu 2 0 #268

Merged
merged 4 commits into from
Oct 21, 2023
Merged

Feature/pay cpu 2 0 #268

merged 4 commits into from
Oct 21, 2023

Conversation

n13
Copy link
Collaborator

@n13 n13 commented Oct 21, 2023

There's a new rule - we can pay for accounts that we created and that are less than 48 hours old

This allows EOS users to onboard in peace without running into CPU / NET problems.

n13 added 4 commits October 21, 2023 20:29
newer accounts created by us can use free cpu action
also never fail with the getFreeCPU action - it should never prevent the popup from appearing. It is a bonus feature.
and newAccountFreshnessHours
final result = await eosService.getAccount(user.accountName, network);
final freshHours = remoteConfigService.newAccountFreshnessHours;
if (result.isValue) {
if (DateTime.now().difference(result.asValue!.value.created!).inHours < freshHours) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make the created field in the account non billable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

non nullable right? the problem is this is the old eosdart code and I didn't want to touch that.

created is always defined

@@ -207,6 +209,8 @@ class RemoteConfigService {
'signUpEnabled': true,
"signUpLinkUrl": "https://dao.hypha.earth/hypha/login",
'walletEnabled': false,
'newAccountFreshnessHours': 48,
'payCpuEnabledNetwork': json.encode({"telos": false, "telosTestnet": true, "eos": true, "eosTestnet": true})
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to add these to firebase

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

payCpuEnabledNetwork had been only in firebase, adding the other one

@n13 n13 merged commit ce9f598 into main Oct 21, 2023
1 of 3 checks passed
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.

2 participants