From 3aace0d7bc94cfcaf9542812306508cf9dec8af5 Mon Sep 17 00:00:00 2001 From: Murisi Tarusenga Date: Wed, 15 Nov 2023 12:55:11 +0200 Subject: [PATCH] Print validator email, website, discord handle, and description in test-vectors. --- sdk/src/signing.rs | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/sdk/src/signing.rs b/sdk/src/signing.rs index 61ec955571b..618e1e4fbb0 100644 --- a/sdk/src/signing.rs +++ b/sdk/src/signing.rs @@ -1086,8 +1086,19 @@ pub async fn to_ledger_vector<'a>( "Maximum commission rate change : {}", init_validator.max_commission_rate_change, ), - format!("Validator VP type : {}", vp_code), + format!("Email : {}", init_validator.email), ]); + if let Some(description) = &init_validator.description { + tv.output.push(format!("Description : {}", description)); + } + if let Some(website) = &init_validator.website { + tv.output.push(format!("Website : {}", website)); + } + if let Some(discord_handle) = &init_validator.discord_handle { + tv.output + .push(format!("Discord handle : {}", discord_handle)); + } + tv.output.push(format!("Validator VP type : {}", vp_code)); tv.output_expert.extend( init_validator @@ -1106,11 +1117,23 @@ pub async fn to_ledger_vector<'a>( "Maximum commission rate change : {}", init_validator.max_commission_rate_change ), - format!( - "Validator VP type : {}", - HEXLOWER.encode(&extra.code.hash().0) - ), + format!("Email : {}", init_validator.email), ]); + if let Some(description) = &init_validator.description { + tv.output_expert + .push(format!("Description : {}", description)); + } + if let Some(website) = &init_validator.website { + tv.output_expert.push(format!("Website : {}", website)); + } + if let Some(discord_handle) = &init_validator.discord_handle { + tv.output_expert + .push(format!("Discord handle : {}", discord_handle)); + } + tv.output_expert.push(format!( + "Validator VP type : {}", + HEXLOWER.encode(&extra.code.hash().0) + )); } else if code_sec.tag == Some(TX_INIT_PROPOSAL.to_string()) { let init_proposal_data = InitProposalData::try_from_slice( &tx.data()