mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-11 17:55:47 +00:00
Support z -> t transactions
This commit is contained in:
parent
8547235b28
commit
84ec286f7f
@ -29,28 +29,22 @@ impl From<TransparentAddress> for RecipientAddress {
|
||||
|
||||
impl RecipientAddress {
|
||||
pub fn from_str(s: &str) -> Option<Self> {
|
||||
// Try to match a sapling z address
|
||||
if let Some(pa) = match decode_payment_address(HRP_SAPLING_PAYMENT_ADDRESS, s) {
|
||||
Ok(ret) => ret,
|
||||
Err(e) => {
|
||||
eprintln!("{}", e);
|
||||
return None;
|
||||
}
|
||||
} {
|
||||
Some(RecipientAddress::Shielded(pa))
|
||||
Ok(ret) => ret,
|
||||
Err(_) => None
|
||||
}
|
||||
{
|
||||
Some(RecipientAddress::Shielded(pa)) // Matched a shielded address
|
||||
} else if let Some(addr) = match decode_transparent_address(
|
||||
&B58_PUBKEY_ADDRESS_PREFIX,
|
||||
&B58_SCRIPT_ADDRESS_PREFIX,
|
||||
s,
|
||||
) {
|
||||
Ok(ret) => ret,
|
||||
Err(e) => {
|
||||
eprintln!("{}", e);
|
||||
return None;
|
||||
}
|
||||
} {
|
||||
Some(RecipientAddress::Transparent(addr))
|
||||
&B58_PUBKEY_ADDRESS_PREFIX, &B58_SCRIPT_ADDRESS_PREFIX, s) {
|
||||
Ok(ret) => ret,
|
||||
Err(_) => None
|
||||
}
|
||||
{
|
||||
Some(RecipientAddress::Transparent(addr)) // Matched a transparent address
|
||||
} else {
|
||||
None
|
||||
None // Didn't match anything
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,9 +89,9 @@ impl Command for SendCommand {
|
||||
|
||||
fn exec(&self, _args: &[String], lightclient: &mut LightClient) {
|
||||
lightclient.do_send(
|
||||
"ztestsapling1x65nq4dgp0qfywgxcwk9n0fvm4fysmapgr2q00p85ju252h6l7mmxu2jg9cqqhtvzd69jwhgv8d".to_string(),
|
||||
"tmHYDCK6PjBMArtDXwPf5bgoFm2Na5fR6Ds".to_string(),
|
||||
150000,
|
||||
Some("Hello from the command".to_string()));
|
||||
None);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user