-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
202 additions
and
62 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
mod market; | ||
mod proofs; | ||
mod randomness; | ||
mod storage_provider; | ||
mod system; | ||
|
||
pub use market::MarketClientExt; | ||
pub use proofs::ProofsClientExt; | ||
pub use randomness::RandomnessClientExt; | ||
pub use storage_provider::StorageProviderClientExt; | ||
pub use system::SystemClientExt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use futures::Future; | ||
use subxt::ext::sp_core::crypto::Ss58Codec; | ||
|
||
use crate::{ | ||
runtime::{self, SubmissionResult}, | ||
PolkaStorageConfig, | ||
}; | ||
|
||
pub trait ProofsClientExt { | ||
fn set_porep_verifying_key<Keypair>( | ||
&self, | ||
account_keypair: &Keypair, | ||
verifying_key: Vec<u8>, | ||
wait_for_finalization: bool, | ||
) -> impl Future<Output = Result<Option<SubmissionResult<PolkaStorageConfig>>, subxt::Error>> | ||
where | ||
Keypair: subxt::tx::Signer<PolkaStorageConfig>; | ||
} | ||
|
||
impl ProofsClientExt for crate::runtime::client::Client { | ||
#[tracing::instrument( | ||
level = "debug", | ||
skip_all, | ||
fields( | ||
address = account_keypair.account_id().to_ss58check(), | ||
) | ||
)] | ||
async fn set_porep_verifying_key<Keypair>( | ||
&self, | ||
account_keypair: &Keypair, | ||
verifying_key: Vec<u8>, | ||
wait_for_finalization: bool, | ||
) -> Result<Option<SubmissionResult<PolkaStorageConfig>>, subxt::Error> | ||
where | ||
Keypair: subxt::tx::Signer<PolkaStorageConfig>, | ||
{ | ||
let payload = runtime::tx() | ||
.proofs() | ||
.set_porep_verifying_key(verifying_key); | ||
|
||
self.traced_submission(&payload, account_keypair, wait_for_finalization) | ||
.await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.