Skip to content
Snippets Groups Projects
Commit aa8494dd authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

update metadata

on runtime 802
changed crypto types
parent a6480ee9
No related branches found
No related tags found
No related merge requests found
Pipeline #38356 canceled
......@@ -2126,7 +2126,7 @@ dependencies = [
[[package]]
name = "gcli"
version = "0.2.17"
version = "0.3.0"
dependencies = [
"age",
"anyhow",
......
......@@ -10,7 +10,7 @@ license = "AGPL-3.0-only"
name = "gcli"
repository = "https://git.duniter.org/clients/rust/gcli-v2s"
description = "A command-line interface for Duniter v2s uses"
version = "0.2.17"
version = "0.3.0"
[dependencies]
# subxt is main dependency
......
No preview for this file type
......@@ -491,9 +491,8 @@ pub async fn revoke_identity(data: &Data) -> Result<(), subxt::Error> {
let (_payload, signature) = generate_revoc_doc(data);
// Transform signature to MultiSignature
// TODO: this is a hack, we should be able to use the signature directly
let signature = runtime::runtime_types::sp_core::sr25519::Signature(signature.0);
let multisign = MultiSignature::Sr25519(signature);
// TODO: allow other signature formats
let multisign = MultiSignature::Sr25519(signature.into());
submit_call_and_look_event::<
runtime::identity::events::IdtyRemoved,
......@@ -562,15 +561,10 @@ pub async fn link_account(
) -> Result<(), subxt::Error> {
let (_payload, signature) = generate_link_account(data, address.clone(), keypair);
// this is a hack, see
// https://substrate.stackexchange.com/questions/10309/how-to-use-core-crypto-types-instead-of-runtime-types
// TODO cleaner way to manage signature
let signature = match signature {
Signature::Sr25519(signature) => MultiSignature::Sr25519(
runtime::runtime_types::sp_core::sr25519::Signature(signature.0),
),
Signature::Nacl(signature) => MultiSignature::Ed25519(
runtime::runtime_types::sp_core::ed25519::Signature(signature.try_into().unwrap()),
),
Signature::Sr25519(signature) => MultiSignature::Sr25519(signature.into()),
Signature::Nacl(signature) => MultiSignature::Ed25519(signature.try_into().unwrap()),
};
submit_call_and_look_event::<
......@@ -591,15 +585,10 @@ pub async fn change_owner_key(
) -> Result<(), subxt::Error> {
let (_payload, signature) = generate_chok_payload(data, address.clone(), keypair);
// this is a hack, see
// https://substrate.stackexchange.com/questions/10309/how-to-use-core-crypto-types-instead-of-runtime-types
// TODO cleaner way to manage signature
let signature = match signature {
Signature::Sr25519(signature) => MultiSignature::Sr25519(
runtime::runtime_types::sp_core::sr25519::Signature(signature.0),
),
Signature::Nacl(signature) => MultiSignature::Ed25519(
runtime::runtime_types::sp_core::ed25519::Signature(signature.try_into().unwrap()),
),
Signature::Sr25519(signature) => MultiSignature::Sr25519(signature.into()),
Signature::Nacl(signature) => MultiSignature::Ed25519(signature.try_into().unwrap()),
};
submit_call_and_look_event::<
......
......@@ -143,10 +143,6 @@ pub async fn runtime_info(data: Data) {
"UD reeval period: {}",
getu64(consts.universal_dividend().ud_reeval_period())
);
println!(
"units per ud: {}",
getf(consts.universal_dividend().units_per_ud())
);
// todo treasury, technical committee, transaction payment, authority members
// consts.system().ss58_prefix()
}
......@@ -13,25 +13,17 @@ type SessionKeys = [u8; 128];
fn session_keys_decode(session_keys: SessionKeys) -> RuntimeSessionKeys {
RuntimeSessionKeys {
grandpa: runtime::runtime_types::sp_consensus_grandpa::app::Public(
runtime::runtime_types::sp_core::ed25519::Public(
session_keys[0..32].try_into().unwrap(),
),
),
babe: runtime::runtime_types::sp_consensus_babe::app::Public(
runtime::runtime_types::sp_core::sr25519::Public(
session_keys[32..64].try_into().unwrap(),
),
),
im_online: runtime::runtime_types::pallet_im_online::sr25519::app_sr25519::Public(
runtime::runtime_types::sp_core::sr25519::Public(
session_keys[64..96].try_into().unwrap(),
),
),
authority_discovery: runtime::runtime_types::sp_authority_discovery::app::Public(
runtime::runtime_types::sp_core::sr25519::Public(
session_keys[96..128].try_into().unwrap(),
),
),
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment