pub struct ForkedSession {
pub id: String,
pub ctx: TxContext,
pub state: ReconstructedState,
pub baseline_trace: Trace,
pub mutations: Vec<(Pubkey, AccountMutation)>,
pub latest_trace: Option<Trace>,
pub created_at: Instant,
}Fields§
§id: String§ctx: TxContext§state: ReconstructedState§baseline_trace: Trace§mutations: Vec<(Pubkey, AccountMutation)>§latest_trace: Option<Trace>§created_at: InstantImplementations§
Source§impl ForkedSession
impl ForkedSession
Sourcepub async fn new(
ctx: TxContext,
state: ReconstructedState,
) -> Result<Self, ReplayError>
pub async fn new( ctx: TxContext, state: ReconstructedState, ) -> Result<Self, ReplayError>
Create a new session. Runs the baseline replay to capture the un-mutated trace — this is the reference point for future diffs.
Sourcepub fn mutate(
&mut self,
pubkey: Pubkey,
mutation: AccountMutation,
) -> Result<(), ReplayError>
pub fn mutate( &mut self, pubkey: Pubkey, mutation: AccountMutation, ) -> Result<(), ReplayError>
Append a mutation to the session’s mutation log. Does NOT re-execute.
Sourcepub async fn execute<C: HeliusClient>(
&mut self,
client: &C,
) -> Result<Trace, ReplayError>
pub async fn execute<C: HeliusClient>( &mut self, client: &C, ) -> Result<Trace, ReplayError>
Execute the transaction with the current mutations applied on top of
reconstructed state. Caches the result in latest_trace.
Auto Trait Implementations§
impl Freeze for ForkedSession
impl RefUnwindSafe for ForkedSession
impl Send for ForkedSession
impl Sync for ForkedSession
impl Unpin for ForkedSession
impl UnsafeUnpin for ForkedSession
impl UnwindSafe for ForkedSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more