Add message publishing skeleton

Change-Id: I18e55f4221575ba782f518d33e1b1f3abcc5d683
This commit is contained in:
Reisen 2021-04-29 11:33:48 +00:00
parent a5f285f1bd
commit ab20f15904
3 changed files with 31 additions and 0 deletions

View File

@ -1,6 +1,8 @@
pub mod initialize;
pub mod publish_message;
pub mod verify_signatures;
// Re-expose underlying module functions and data, for consuming APIs to use.
pub use initialize::*;
pub use publish_message::*;
pub use verify_signatures::*;

View File

@ -0,0 +1,16 @@
use anchor_lang::{prelude::*, solana_program};
use crate::{
accounts,
anchor_bridge::Bridge,
types::{BridgeConfig, Version},
PublishMessage,
};
pub fn publish_message(
bridge: &mut Bridge,
ctx: Context<PublishMessage>,
) -> ProgramResult {
Ok(())
}

View File

@ -69,6 +69,12 @@ pub struct InitializeData {
pub config: BridgeConfig,
}
#[derive(Accounts)]
pub struct PublishMessage {}
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)]
pub struct PublishMessageData {}
#[program]
pub mod anchor_bridge {
use super::*;
@ -89,6 +95,13 @@ pub mod anchor_bridge {
)
}
pub fn publish_message(&mut self, ctx: Context<PublishMessage>, data: PublishMessageData) -> ProgramResult {
api::publish_message(
self,
ctx,
)
}
pub fn verify_signatures(&mut self, ctx: Context<VerifySig>, data: VerifySigsData) -> ProgramResult {
api::verify_signatures(
self,