pub trait DeploymentStorage<N: Network>: Clone + Send + Sync {
type IDMap: for<'a> Map<'a, N::TransactionID, ProgramID<N>>;
type EditionMap: for<'a> Map<'a, ProgramID<N>, u16>;
type ReverseIDMap: for<'a> Map<'a, (ProgramID<N>, u16), N::TransactionID>;
type OwnerMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramOwner<N>>;
type ProgramMap: for<'a> Map<'a, (ProgramID<N>, u16), Program<N>>;
type VerifyingKeyMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), VerifyingKey<N>>;
type CertificateMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), Certificate<N>>;
type FeeStorage: FeeStorage<N>;
Show 30 methods
// Required methods
fn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self>;
fn id_map(&self) -> &Self::IDMap;
fn edition_map(&self) -> &Self::EditionMap;
fn reverse_id_map(&self) -> &Self::ReverseIDMap;
fn owner_map(&self) -> &Self::OwnerMap;
fn program_map(&self) -> &Self::ProgramMap;
fn verifying_key_map(&self) -> &Self::VerifyingKeyMap;
fn certificate_map(&self) -> &Self::CertificateMap;
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>;
// Provided methods
fn dev(&self) -> Option<u16> { ... }
fn start_atomic(&self) { ... }
fn is_atomic_in_progress(&self) -> bool { ... }
fn atomic_checkpoint(&self) { ... }
fn clear_latest_checkpoint(&self) { ... }
fn atomic_rewind(&self) { ... }
fn abort_atomic(&self) { ... }
fn finish_atomic(&self) -> Result<()> { ... }
fn insert(&self, transaction: &Transaction<N>) -> Result<()> { ... }
fn remove(&self, transaction_id: &N::TransactionID) -> Result<()> { ... }
fn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>
) -> Result<Option<N::TransactionID>> { ... }
fn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID
) -> Result<Option<N::TransactionID>> { ... }
fn get_program_id(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<ProgramID<N>>> { ... }
fn get_edition(&self, program_id: &ProgramID<N>) -> Result<Option<u16>> { ... }
fn get_program(
&self,
program_id: &ProgramID<N>
) -> Result<Option<Program<N>>> { ... }
fn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<Option<VerifyingKey<N>>> { ... }
fn get_certificate(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<Option<Certificate<N>>> { ... }
fn get_deployment(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Deployment<N>>> { ... }
fn get_fee(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Fee<N>>> { ... }
fn get_owner(
&self,
program_id: &ProgramID<N>
) -> Result<Option<ProgramOwner<N>>> { ... }
fn get_transaction(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Transaction<N>>> { ... }
}
Expand description
A trait for deployment storage.
Required Associated Types§
sourcetype IDMap: for<'a> Map<'a, N::TransactionID, ProgramID<N>>
type IDMap: for<'a> Map<'a, N::TransactionID, ProgramID<N>>
The mapping of transaction ID
to program ID
.
sourcetype EditionMap: for<'a> Map<'a, ProgramID<N>, u16>
type EditionMap: for<'a> Map<'a, ProgramID<N>, u16>
The mapping of program ID
to edition
.
sourcetype ReverseIDMap: for<'a> Map<'a, (ProgramID<N>, u16), N::TransactionID>
type ReverseIDMap: for<'a> Map<'a, (ProgramID<N>, u16), N::TransactionID>
The mapping of (program ID, edition)
to transaction ID
.
sourcetype OwnerMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramOwner<N>>
type OwnerMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramOwner<N>>
The mapping of (program ID, edition)
to ProgramOwner
.
sourcetype ProgramMap: for<'a> Map<'a, (ProgramID<N>, u16), Program<N>>
type ProgramMap: for<'a> Map<'a, (ProgramID<N>, u16), Program<N>>
The mapping of (program ID, edition)
to program
.
sourcetype VerifyingKeyMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), VerifyingKey<N>>
type VerifyingKeyMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), VerifyingKey<N>>
The mapping of (program ID, function name, edition)
to verifying key
.
sourcetype CertificateMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), Certificate<N>>
type CertificateMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), Certificate<N>>
The mapping of (program ID, function name, edition)
to certificate
.
sourcetype FeeStorage: FeeStorage<N>
type FeeStorage: FeeStorage<N>
The fee storage.
Required Methods§
sourcefn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self>
fn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self>
Initializes the deployment storage.
sourcefn edition_map(&self) -> &Self::EditionMap
fn edition_map(&self) -> &Self::EditionMap
Returns the edition map.
sourcefn reverse_id_map(&self) -> &Self::ReverseIDMap
fn reverse_id_map(&self) -> &Self::ReverseIDMap
Returns the reverse ID map.
sourcefn program_map(&self) -> &Self::ProgramMap
fn program_map(&self) -> &Self::ProgramMap
Returns the program map.
sourcefn verifying_key_map(&self) -> &Self::VerifyingKeyMap
fn verifying_key_map(&self) -> &Self::VerifyingKeyMap
Returns the verifying key map.
sourcefn certificate_map(&self) -> &Self::CertificateMap
fn certificate_map(&self) -> &Self::CertificateMap
Returns the certificate map.
sourcefn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
Returns the fee storage.
Provided Methods§
sourcefn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
sourcefn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
sourcefn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
sourcefn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
sourcefn atomic_rewind(&self)
fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
sourcefn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcefn finish_atomic(&self) -> Result<()>
fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
sourcefn insert(&self, transaction: &Transaction<N>) -> Result<()>
fn insert(&self, transaction: &Transaction<N>) -> Result<()>
Stores the given deployment transaction
pair into storage.
sourcefn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
fn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
Removes the deployment transaction for the given transaction ID
.
sourcefn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>
) -> Result<Option<N::TransactionID>>
fn find_transaction_id_from_program_id( &self, program_id: &ProgramID<N> ) -> Result<Option<N::TransactionID>>
Returns the transaction ID that contains the given program ID
.
sourcefn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID
) -> Result<Option<N::TransactionID>>
fn find_transaction_id_from_transition_id( &self, transition_id: &N::TransitionID ) -> Result<Option<N::TransactionID>>
Returns the transaction ID that contains the given transition ID
.
sourcefn get_program_id(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<ProgramID<N>>>
fn get_program_id( &self, transaction_id: &N::TransactionID ) -> Result<Option<ProgramID<N>>>
Returns the program ID for the given transaction ID
.
sourcefn get_edition(&self, program_id: &ProgramID<N>) -> Result<Option<u16>>
fn get_edition(&self, program_id: &ProgramID<N>) -> Result<Option<u16>>
Returns the edition for the given program ID
.
sourcefn get_program(&self, program_id: &ProgramID<N>) -> Result<Option<Program<N>>>
fn get_program(&self, program_id: &ProgramID<N>) -> Result<Option<Program<N>>>
Returns the program for the given program ID
.
sourcefn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<Option<VerifyingKey<N>>>
fn get_verifying_key( &self, program_id: &ProgramID<N>, function_name: &Identifier<N> ) -> Result<Option<VerifyingKey<N>>>
Returns the verifying key for the given program ID
and function name
.
sourcefn get_certificate(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<Option<Certificate<N>>>
fn get_certificate( &self, program_id: &ProgramID<N>, function_name: &Identifier<N> ) -> Result<Option<Certificate<N>>>
Returns the certificate for the given program ID
and function name
.
sourcefn get_deployment(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Deployment<N>>>
fn get_deployment( &self, transaction_id: &N::TransactionID ) -> Result<Option<Deployment<N>>>
Returns the deployment for the given transaction ID
.
sourcefn get_fee(&self, transaction_id: &N::TransactionID) -> Result<Option<Fee<N>>>
fn get_fee(&self, transaction_id: &N::TransactionID) -> Result<Option<Fee<N>>>
Returns the fee for the given transaction ID
.
sourcefn get_owner(
&self,
program_id: &ProgramID<N>
) -> Result<Option<ProgramOwner<N>>>
fn get_owner( &self, program_id: &ProgramID<N> ) -> Result<Option<ProgramOwner<N>>>
Returns the owner for the given program ID
.
sourcefn get_transaction(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<Transaction<N>>>
fn get_transaction( &self, transaction_id: &N::TransactionID ) -> Result<Option<Transaction<N>>>
Returns the transaction for the given transaction ID
.