pub struct OdraCli { /* private fields */ }Expand description
Command line interface for Odra smart contracts.
Implementations§
Source§impl OdraCli
impl OdraCli
Sourcepub fn contracts_file<P: AsRef<Path>>(self, path: P) -> Self
pub fn contracts_file<P: AsRef<Path>>(self, path: P) -> Self
Sets the path to a file that stores the deployed contract addresses.
The path is relative to the resources directory in the project root.
Sourcepub fn contract<T: SchemaEntrypoints + SchemaCustomTypes + SchemaEvents + OdraContract>(
self,
) -> Self
pub fn contract<T: SchemaEntrypoints + SchemaCustomTypes + SchemaEvents + OdraContract>( self, ) -> Self
Adds a contract to the CLI.
Generates a subcommand for the contract with all of its entry points except the init entry point.
To call the constructor of the contract, implement and register the DeployScript.
Sourcepub fn named_contract<T: SchemaEntrypoints + SchemaCustomTypes + SchemaEvents + OdraContract>(
self,
name: String,
) -> Self
pub fn named_contract<T: SchemaEntrypoints + SchemaCustomTypes + SchemaEvents + OdraContract>( self, name: String, ) -> Self
Adds a named contract to the CLI, in case of multiple instances of the same contract.
Generates a subcommand for the contract with all of its entry points except the init entry point.
To call the constructor of the contract, implement and register the DeployScript.
Sourcepub fn deploy(self, script: impl DeployScript + 'static) -> Self
pub fn deploy(self, script: impl DeployScript + 'static) -> Self
Adds a deploy script to the CLI.
There is only one deploy script allowed in the CLI.
Sourcepub fn scenario<S: ScenarioMetadata + Scenario>(self, scenario: S) -> Self
pub fn scenario<S: ScenarioMetadata + Scenario>(self, scenario: S) -> Self
Adds a scenario to the CLI.
Scenarios are user-defined commands that can be run from the CLI. If there is a complex set of commands that need to be run in a specific order, a scenario can be used to group them together.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OdraCli
impl !RefUnwindSafe for OdraCli
impl !Send for OdraCli
impl !Sync for OdraCli
impl Unpin for OdraCli
impl !UnwindSafe for OdraCli
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
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>
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>
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