Skip to content

Commit

Permalink
Merge branch 'main' into runtime-interaction-example
Browse files Browse the repository at this point in the history
  • Loading branch information
pmikolajczyk41 authored Nov 22, 2023
2 parents a684ddb + 4accef3 commit 9b76a85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ homepage = "https://github.com/Cardinal-Cryptography/drink"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/Cardinal-Cryptography/drink"
version = "0.8.1"
version = "0.8.2"

[workspace.dependencies]
anyhow = { version = "1.0.71" }
Expand Down
10 changes: 10 additions & 0 deletions drink/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ impl<R: RuntimeWithContracts> Session<R> {
Self { actor, ..self }
}

/// Returns currently set actor.
pub fn get_actor(&self) -> AccountIdFor<R> {
self.actor.clone()
}

/// Sets a new actor and returns the old one.
pub fn set_actor(&mut self, actor: AccountIdFor<R>) -> AccountIdFor<R> {
mem::replace(&mut self.actor, actor)
Expand All @@ -181,6 +186,11 @@ impl<R: RuntimeWithContracts> Session<R> {
mem::replace(&mut self.gas_limit, gas_limit)
}

/// Returns currently set gas limit.
pub fn get_gas_limit(&self) -> Weight {
self.gas_limit
}

/// Sets a new determinism policy and returns updated `self`.
pub fn with_determinism(self, determinism: Determinism) -> Self {
Self {
Expand Down

0 comments on commit 9b76a85

Please sign in to comment.