Skip to content

Commit

Permalink
Update subxt (#709)
Browse files Browse the repository at this point in the history
* Update subxt

* Fix tangle-subxt

* Updates

* Fix subxt update
  • Loading branch information
drewstone authored Jul 25, 2024
1 parent ff0251a commit 120018b
Show file tree
Hide file tree
Showing 20 changed files with 57,538 additions and 43,803 deletions.
495 changes: 391 additions & 104 deletions Cargo.lock

Large diffs are not rendered by default.

62 changes: 30 additions & 32 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,36 @@ exclude = [

[workspace]
members = [
"primitives",
"primitives/crypto",
"primitives/rpc/*",
"primitives/ext",
"client/evm-tracing",
"client/rpc/*",
"client/rpc-core/*",
"client/voter",
"node",
"runtime/testnet",
"runtime/mainnet",
"pallets/*",
"pallets/jobs/rpc",
"pallets/jobs/rpc/runtime-api",
"pallets/dkg/frost",
"pallets/dkg/frost/frost-*",
"precompiles/utils",
"precompiles/utils/macro",
"precompiles/utils/tests-external",
"precompiles/pallet-democracy",
"precompiles/batch",
"precompiles/call-permit",
"precompiles/proxy",
"precompiles/preimage",
"precompiles/jobs",
"precompiles/balances-erc20",
"precompiles/assets-erc20",
"tangle-subxt",
"examples/*",
"evm-tracer"
# "relayer-gadget",
# "relayer-gadget/cli",
"primitives",
"primitives/crypto",
"primitives/rpc/*",
"primitives/ext",
"client/evm-tracing",
"client/rpc/*",
"client/rpc-core/*",
"client/voter",
"node",
"runtime/testnet",
"runtime/mainnet",
"pallets/*",
"pallets/jobs/rpc",
"pallets/jobs/rpc/runtime-api",
"pallets/dkg/frost",
"pallets/dkg/frost/frost-*",
"precompiles/utils",
"precompiles/utils/macro",
"precompiles/utils/tests-external",
"precompiles/pallet-democracy",
"precompiles/batch",
"precompiles/call-permit",
"precompiles/proxy",
"precompiles/preimage",
"precompiles/jobs",
"precompiles/balances-erc20",
"precompiles/assets-erc20",
"tangle-subxt",
"examples/*",
"evm-tracer"
]
resolver = "2"

Expand Down
4 changes: 2 additions & 2 deletions examples/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0-only"
repository = { workspace = true }

[dev-dependencies]
subxt-signer = { version = "0.34.0", default-features = false, features = ["subxt", "sr25519", "native"] }
subxt-signer = { version = "0.37.0", default-features = false, features = ["subxt", "sr25519"] }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0" }
tokio = { version = "1.32.0", features = ["full"] }
Expand All @@ -16,6 +16,6 @@ tangle-subxt = { path = "../../tangle-subxt" }
hex = {workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
subxt = { version = "0.34.0" }
subxt = { version = "0.37.0" }
serde_json = { workspace = true }
ethers = "2.0.13"
5 changes: 3 additions & 2 deletions examples/contracts/examples/deploy_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ async fn main() -> Result<(), String> {
.sign_and_submit_then_watch_default(&sudo_create2_call, &alice)
.await
.unwrap()
.wait_for_finalized_success()
.wait_for_finalized()
.await
.unwrap();

let deployed_contract = result.find_first::<TangleApi::evm::events::Created>().unwrap();
let rresult = result.wait_for_success().await.unwrap();
let deployed_contract = rresult.find_first::<TangleApi::evm::events::Created>().unwrap();

let _contract_address = match deployed_contract {
Some(contract) => {
Expand Down
7 changes: 4 additions & 3 deletions examples/contracts/examples/submit_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ async fn main() -> Result<(), String> {
.sign_and_submit_then_watch_default(&sudo_create2_call, &alice)
.await
.unwrap()
.wait_for_finalized_success()
.wait_for_finalized()
.await
.unwrap();

let deployed_contract = result.find_first::<TangleApi::evm::events::Created>().unwrap();
let rresult = result.wait_for_success().await.unwrap();
let deployed_contract = rresult.find_first::<TangleApi::evm::events::Created>().unwrap();

let contract_address = match deployed_contract {
Some(contract) => {
Expand Down Expand Up @@ -216,7 +217,7 @@ async fn main() -> Result<(), String> {
.sign_and_submit_then_watch_default(&sudo_init_tx_call, &alice)
.await
.unwrap()
.wait_for_finalized_success()
.wait_for_finalized()
.await
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions examples/jobs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ license = "GPL-3.0-only"
repository = { workspace = true }

[dev-dependencies]
subxt-signer = { version = "0.34.0", default-features = false, features = ["subxt", "sr25519", "native"] }
subxt-signer = { version = "0.37.0", default-features = false, features = ["subxt", "sr25519"] }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0" }
tokio = { version = "1.32.0", features = ["full"] }
tangle-crypto-primitives = { path = "../../primitives/crypto"}
tangle-subxt = { path = "../../tangle-subxt" }
hex = {workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
subxt = { version = "0.34.0" }
subxt = { version = "0.37.0" }
serde_json = { workspace = true }
ethers = "2.0.13"
8 changes: 3 additions & 5 deletions examples/jobs/examples/key_rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ use crate::tangle_testnet_runtime::api::{
};

use sp_core::{ByteArray, Pair};
use tangle_subxt::subxt::{tx::Signer, utils::AccountId32, OnlineClient, PolkadotConfig};
use tangle_subxt::subxt::{utils::AccountId32, OnlineClient, PolkadotConfig};
use tangle_subxt::tangle_testnet_runtime;

#[tokio::main]
async fn main() -> Result<(), String> {
let subxt_client = OnlineClient::<PolkadotConfig>::new().await.unwrap();
let alice = subxt_signer::sr25519::dev::alice();
let bob = subxt_signer::sr25519::dev::bob();
let alice_account_id =
<subxt_signer::sr25519::Keypair as Signer<PolkadotConfig>>::account_id(&alice);
let bob_account_id =
<subxt_signer::sr25519::Keypair as Signer<PolkadotConfig>>::account_id(&bob);
let alice_account_id = alice.public_key().to_account_id();
let bob_account_id = bob.public_key().to_account_id();
let alice_role_key = sp_core::ecdsa::Pair::from_string("//Alice", None).unwrap();
let bob_role_key = sp_core::ecdsa::Pair::from_string("//Bob", None).unwrap();

Expand Down
4 changes: 2 additions & 2 deletions examples/profile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0-only"
repository = { workspace = true }

[dev-dependencies]
subxt-signer = { version = "0.34.0", default-features = false, features = ["subxt", "sr25519", "native"] }
subxt-signer = { version = "0.37.0", default-features = false, features = ["subxt", "sr25519"] }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0" }
tokio = { version = "1.32.0", features = ["full"] }
Expand All @@ -16,4 +16,4 @@ tangle-subxt = { path = "../../tangle-subxt" }
hex = {workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }
subxt = { version = "0.34.0" }
subxt = { version = "0.37.0" }
24 changes: 0 additions & 24 deletions relayer-gadget/Cargo.toml

This file was deleted.

11 changes: 0 additions & 11 deletions relayer-gadget/cli/Cargo.toml

This file was deleted.

10 changes: 0 additions & 10 deletions relayer-gadget/cli/src/lib.rs

This file was deleted.

3 changes: 0 additions & 3 deletions relayer-gadget/config/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions relayer-gadget/config/simple.toml

This file was deleted.

120 changes: 0 additions & 120 deletions relayer-gadget/src/lib.rs

This file was deleted.

Loading

0 comments on commit 120018b

Please sign in to comment.