Skip to content

Commit

Permalink
fix seed parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
stegaBOB committed Aug 14, 2022
1 parent bf11f81 commit 760beaf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lang/syn/src/idl/pda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::ConstraintSeedsGroup;
use crate::{AccountsStruct, Field};
use std::collections::HashMap;
use std::str::FromStr;
use syn::Expr;
use syn::{Expr, ExprLit, Lit};

// Parses a seeds constraint, extracting the IdlSeed types.
//
Expand Down Expand Up @@ -118,6 +118,13 @@ impl<'a> PdaParser<'a> {
println!("WARNING: auto pda derivation not currently supported for slice literals");
None
}
Expr::Lit(ExprLit {
lit: Lit::ByteStr(lit_byte_str),
..
}) => {
let seed_path: SeedPath = SeedPath(lit_byte_str.token().to_string(), Vec::new());
self.parse_str_literal(&seed_path)
}
// Unknown type. Please file an issue.
_ => {
println!("WARNING: unexpected seed: {:?}", seed);
Expand Down

0 comments on commit 760beaf

Please sign in to comment.