Skip to content

Commit 3533192

Browse files
authored
A0-4251: Support executing readonly contract calls at a given block in aleph client (#1679)
# Description Add a possibility to execute read-only contract call at a given block hash, similarly as in JAMdotTech/py-polkadot-sdk@298c35c. E2e test run: https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/8664362669 ## Type of change Please delete options that are not relevant. - New feature (non-breaking change which adds functionality) # Checklist: <!-- delete when not applicable to your PR --> - I have added tests - I have made corresponding changes to the existing documentation - I have created new documentation - I have bumped aleph-client version if relevant
1 parent 2a630c2 commit 3533192

File tree

13 files changed

+315
-141
lines changed

13 files changed

+315
-141
lines changed

aleph-client/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aleph-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleph_client"
3-
version = "3.13.0"
3+
version = "3.14.0"
44
edition = "2021"
55
authors = ["Cardinal"]
66
documentation = "https://docs.rs/aleph_client"

aleph-client/src/aleph_zero.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,9 +1982,9 @@ pub mod api {
19821982
.hash();
19831983
runtime_metadata_hash
19841984
== [
1985-
129u8, 73u8, 18u8, 89u8, 210u8, 235u8, 7u8, 3u8, 129u8, 129u8, 29u8, 138u8, 74u8,
1986-
244u8, 76u8, 191u8, 250u8, 90u8, 146u8, 240u8, 112u8, 108u8, 18u8, 204u8, 45u8,
1987-
173u8, 154u8, 15u8, 217u8, 19u8, 68u8, 99u8,
1985+
168u8, 45u8, 34u8, 180u8, 15u8, 198u8, 195u8, 94u8, 185u8, 186u8, 175u8, 22u8,
1986+
25u8, 103u8, 4u8, 51u8, 38u8, 113u8, 76u8, 98u8, 201u8, 223u8, 80u8, 32u8, 39u8,
1987+
11u8, 176u8, 247u8, 172u8, 235u8, 72u8, 171u8,
19881988
]
19891989
}
19901990
pub mod system {
@@ -9147,10 +9147,10 @@ pub mod api {
91479147
"NextAuthorities",
91489148
vec![],
91499149
[
9150-
168u8, 56u8, 208u8, 207u8, 106u8, 51u8, 50u8, 57u8, 201u8, 86u8, 133u8,
9151-
93u8, 11u8, 243u8, 93u8, 77u8, 255u8, 163u8, 166u8, 116u8, 213u8,
9152-
232u8, 224u8, 204u8, 254u8, 196u8, 33u8, 12u8, 162u8, 107u8, 100u8,
9153-
231u8,
9150+
88u8, 232u8, 148u8, 12u8, 95u8, 135u8, 116u8, 72u8, 113u8, 140u8, 45u8,
9151+
103u8, 56u8, 19u8, 149u8, 114u8, 82u8, 188u8, 121u8, 184u8, 104u8,
9152+
254u8, 228u8, 185u8, 4u8, 151u8, 251u8, 63u8, 189u8, 76u8, 173u8,
9153+
101u8,
91549154
],
91559155
)
91569156
}

aleph-client/src/contract/event.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub struct ContractEvent {
5656
/// # async fn example(conn: Connection, signed_conn: SignedConnection, address: AccountId, path: &str) -> Result<()> {
5757
/// let contract = ContractInstance::new(address, path)?;
5858
///
59-
/// let tx_info = contract.contract_exec0(&signed_conn, "some_method").await?;
59+
/// let tx_info = contract.exec0(&signed_conn, "some_method", Default::default()).await?;
6060
///
6161
/// println!("Received events {:?}", get_contract_events(&conn, &contract, tx_info).await);
6262
///
@@ -110,8 +110,8 @@ pub async fn get_contract_events(
110110
/// };
111111
/// let join = tokio::spawn(listen());
112112
///
113-
/// contract1.contract_exec0(&signed_conn, "some_method").await?;
114-
/// contract2.contract_exec0(&signed_conn, "some_other_method").await?;
113+
/// contract1.exec0(&signed_conn, "some_method", Default::default()).await?;
114+
/// contract2.exec0(&signed_conn, "some_other_method", Default::default()).await?;
115115
///
116116
/// println!("Received event {:?}", rx.next().await);
117117
///

0 commit comments

Comments
 (0)