Skip to content

Instantly share code, notes, and snippets.

View stegaBOB's full-sized avatar

Sammy Harris stegaBOB

View GitHub Profile
@stegaBOB
stegaBOB / optimalTransaction.ts
Last active April 22, 2024 15:42
Gets an optimal transaction with priority fees and minimum CU limits in parallel with Promise.all
async function getPriorityFees(instructions: TransactionInstruction[]): Promise<number> {
// replace with real function
return 426;
}
async function getSimulationUnits(
connection: Connection,
instructions: TransactionInstruction[],
payer: PublicKey,
lookupTables: AddressLookupTableAccount[]
@stegaBOB
stegaBOB / from_into_stack_overflow.rs
Created November 4, 2022 04:42
Using Into to implement From builds and causes a stack overflow at runtime
#[derive(Default, Debug)]
pub struct Bar {
pub bob: String,
}
#[derive(Default, Debug)]
pub struct Foo {
pub alice: u16,
}