Skip to content

Commit

Permalink
Merge pull request #55 from dusk-network/bs58-fix
Browse files Browse the repository at this point in the history
Fixed bs58 regression in user command
  • Loading branch information
miloszm authored Nov 22, 2023
2 parents ddc9cc1 + 47c7278 commit 3df5b29
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions moat-cli/moat-cli-user/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,17 @@ impl Command {

/// Command: Submit Request
#[allow(non_snake_case)]
async fn submit_request(
async fn submit_request<T: AsRef<str>>(
wallet_path: &WalletPath,
psw: &Password,
blockchain_access_config: &BlockchainAccessConfig,
gas_limit: u64,
gas_price: u64,
ssk: SecretSpendKey,
psk_lp_bytes: String,
psk_lp_bytes: T,
) -> Result<RunResult, Error> {
let psk_lp_bytes_formatted = hex::decode(psk_lp_bytes.clone())?;
let psk_lp_bytes_formatted =
bs58::decode(psk_lp_bytes.as_ref()).into_vec()?;
let psk_lp =
PublicSpendKey::from_slice(psk_lp_bytes_formatted.as_slice())?;

Expand All @@ -140,7 +141,7 @@ impl Command {
TxAwaiter::wait_for(&client, tx_id).await?;

let summary = SubmitRequestSummary {
psk_lp: psk_lp_bytes,
psk_lp: psk_lp_bytes.as_ref().to_string(),
tx_id: hex::encode(tx_id.to_bytes()),
request_hash,
};
Expand Down

0 comments on commit 3df5b29

Please sign in to comment.