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

certified capacity paid as DIY capacity #991

Open
sameh-farouk opened this issue Jul 16, 2024 · 0 comments
Open

certified capacity paid as DIY capacity #991

sameh-farouk opened this issue Jul 16, 2024 · 0 comments
Assignees
Labels
tfchain tfchain repo issue type_bug Something isn't working
Milestone

Comments

@sameh-farouk
Copy link
Member

sameh-farouk commented Jul 16, 2024

Going through the code, certified capacity should cost 25% more here

// calculate the new amount due given the discount
let mut amount_due = U64F64::from_num(amount_due) * discount_received.price_multiplier();
// Certified capacity costs 25% more
if certification_type == NodeCertification::Certified {
amount_due = amount_due * U64F64::from_num(1.25);
}

But I can see that the DIY type is hardcoded here, We are not getting it from the Node

pub fn calculate_contract_cost_tft(
&self,
balance: BalanceOf<T>,
seconds_elapsed: u64,
) -> Result<(BalanceOf<T>, types::DiscountLevel), DispatchErrorWithPostInfo> {
// Fetch the default pricing policy and certification type
let pricing_policy = pallet_tfgrid::PricingPolicies::<T>::get(1).unwrap();
let certification_type = NodeCertification::Diy;

Any reason behind that? Maybe the CERTFIED nodes weren't yet lunched at the time of writing this part?

@sameh-farouk sameh-farouk self-assigned this Jul 16, 2024
@sameh-farouk sameh-farouk added the type_bug Something isn't working label Jul 16, 2024
@sameh-farouk sameh-farouk added this to the 2.9.0 milestone Jul 16, 2024
@sameh-farouk sameh-farouk removed their assignment Jul 16, 2024
@sameh-farouk sameh-farouk removed this from the 2.9.0 milestone Jul 16, 2024
@sameh-farouk sameh-farouk self-assigned this Jul 18, 2024
@sameh-farouk sameh-farouk added this to the 2.9.0 milestone Jul 18, 2024
@sameh-farouk sameh-farouk added the tfchain tfchain repo issue label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tfchain tfchain repo issue type_bug Something isn't working
Projects
Status: In Verification
Development

No branches or pull requests

1 participant