-
Notifications
You must be signed in to change notification settings - Fork 13
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
fetch weight from remote node #237
Conversation
use pallet_transaction_payment::RuntimeDispatchInfo; | ||
use sp_core::Bytes; | ||
|
||
pub static SHARED_CLIENT: OnceCell<SubxtClient> = OnceCell::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is needed because the MinerConfig trait
doesn't take &self, so I had to use a global variable fine for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One mistake with desired_targets
otherwise looks good.
} | ||
|
||
fn mock_votes(voters: u32, desired_targets: u16) -> Vec<(u32, u16)> { | ||
assert!(voters >= desired_targets as u32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this assertion must be true because all the "desired targets" be used?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. Since we're using only votes1
, we should have at at least enough voters to cover all targets.
..Default::default() | ||
}; | ||
|
||
assert_eq!(raw.solution.voter_count(), active_voters as usize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as these pass, we're good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bueno
Closing #12