Skip to main content

MinerInstruction

Enum MinerInstruction 

Source
#[repr(u8)]
pub enum MinerInstruction { Initialize = 0, Register = 1, AuthorizeSession = 2, Mine = 3, Claim = 4, Crank = 5, CloseRound = 6, UpdateConfig = 7, SetAdmin = 8, }
Expand description

Tagi instrukcji (pierwszy bajt danych).

Variants§

§

Initialize = 0

Inicjalizacja programu. Konta: [admin (signer, payer), config (PDA), mint, round0 (PDA), system_program] Wymagania wobec minta (tworzonego poza programem przed initialize): decimals = 9, mint_authority = PDA “treasury”, freeze_authority = None.

§

Register = 1

Rejestracja minera. Konta: [authority (signer, payer), miner (PDA), slot_hashes, system_program]

§

AuthorizeSession = 2

Ustawienie session keya (podpisuje submity w tle). Konta: [authority (signer), miner] Dane: session_key [u8;32] (zera = odwołanie)

§

Mine = 3

Submit hasha (raz na rundę): weryfikacja PoW, naliczenie wagi, rozliczenie poprzedniej rundy (lazy). Konta: [signer (authority lub session), miner, config, current_round, prev_round, token_account (ATA authority), slot_hashes] Dane: nonce u64 LE

§

Claim = 4

Odbiór naliczonych nagród (mint do ATA authority). Konta: [authority (signer), miner, config, prev_round, mint, treasury (PDA), token_account (ATA authority), token_program]

§

Crank = 5

Zamknięcie rundy i otwarcie kolejnej (permissionless crank). Konta: [payer (signer), config, new_round (PDA), system_program]

§

CloseRound = 6

Zamknięcie starego konta rundy po retencji (rent dla wołającego). Konta: [recipient (signer), config, round]

§

UpdateConfig = 7

Zmiana parametrów przez admina. Konta: [admin (signer), config] Dane: min_difficulty u64 LE, base_weight u64 LE, round_seconds u64 LE

§

SetAdmin = 8

Przekazanie roli admina (docelowo: multisig z timelockiem). Konta: [admin (signer), config] Dane: new_admin [u8;32]

Implementations§

Trait Implementations§

Source§

impl Clone for MinerInstruction

Source§

fn clone(&self) -> MinerInstruction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MinerInstruction

Source§

impl Debug for MinerInstruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MinerInstruction

Source§

impl PartialEq for MinerInstruction

Source§

fn eq(&self, other: &MinerInstruction) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MinerInstruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.