sdk/solana: post_message: added multiple seeds. (#838)
This commit is contained in:
parent
4bc5daa8d1
commit
087506dec6
|
@ -86,7 +86,7 @@ pub fn post_message(
|
||||||
message: Pubkey,
|
message: Pubkey,
|
||||||
payload: impl AsRef<[u8]>,
|
payload: impl AsRef<[u8]>,
|
||||||
consistency: ConsistencyLevel,
|
consistency: ConsistencyLevel,
|
||||||
seeds: Option<&[&[u8]]>,
|
pda_seeds: Option<&[&[&[u8]]]>,
|
||||||
accounts: &[AccountInfo],
|
accounts: &[AccountInfo],
|
||||||
nonce: u32,
|
nonce: u32,
|
||||||
) -> ProgramResult {
|
) -> ProgramResult {
|
||||||
|
@ -103,6 +103,11 @@ pub fn post_message(
|
||||||
let config = accounts.iter().find(|item| *item.key == config).unwrap();
|
let config = accounts.iter().find(|item| *item.key == config).unwrap();
|
||||||
let config = read_config(config).unwrap();
|
let config = read_config(config).unwrap();
|
||||||
|
|
||||||
|
let mut seeds = vec![&*emitter_seeds];
|
||||||
|
if let Some(v) = pda_seeds {
|
||||||
|
seeds.extend(v);
|
||||||
|
}
|
||||||
|
|
||||||
// Pay Fee to the Wormhole
|
// Pay Fee to the Wormhole
|
||||||
invoke_signed(
|
invoke_signed(
|
||||||
&solana_program::system_instruction::transfer(
|
&solana_program::system_instruction::transfer(
|
||||||
|
@ -127,7 +132,7 @@ pub fn post_message(
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
accounts,
|
accounts,
|
||||||
&[&emitter_seeds, seeds.unwrap_or(&[])],
|
&seeds
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in New Issue