Wallet token parser shouldn't parse all
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -132,16 +132,14 @@ impl TokenSerializable for Wallet {
|
|||||||
fn parse_from_tokens<'a>(
|
fn parse_from_tokens<'a>(
|
||||||
parser: &mut tokenator::TokenParser<'a>,
|
parser: &mut tokenator::TokenParser<'a>,
|
||||||
) -> Result<Self, tokenator::ParseError<'a>> {
|
) -> Result<Self, tokenator::ParseError<'a>> {
|
||||||
parser.parse_all(|p| {
|
parser.parse_token("nwc_uri")?;
|
||||||
p.parse_token("nwc_uri")?;
|
|
||||||
|
|
||||||
let raw_uri = p.pull_token()?;
|
let raw_uri = parser.pull_token()?;
|
||||||
|
|
||||||
let wallet =
|
let wallet =
|
||||||
Wallet::new(raw_uri.to_owned()).map_err(|_| tokenator::ParseError::DecodeFailed)?;
|
Wallet::new(raw_uri.to_owned()).map_err(|_| tokenator::ParseError::DecodeFailed)?;
|
||||||
|
|
||||||
Ok(wallet)
|
Ok(wallet)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn serialize_tokens(&self, writer: &mut tokenator::TokenWriter) {
|
fn serialize_tokens(&self, writer: &mut tokenator::TokenWriter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user