Skip to content

Commit

Permalink
Update examples and integration-tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv committed May 4, 2022
1 parent e8ecbab commit 5423f6e
Show file tree
Hide file tree
Showing 19 changed files with 1,302 additions and 1,242 deletions.
3 changes: 2 additions & 1 deletion examples/examples/balance_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let hash = api
.tx()
.balances()
.transfer(dest, 123_456_789_012_345)?
.transfer(dest, 123_456_789_012_345)
.await?
.sign_and_submit_default(&signer)
.await?;

Expand Down
3 changes: 2 additions & 1 deletion examples/examples/balance_transfer_with_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let hash = api
.tx()
.balances()
.transfer(dest, 123_456_789_012_345)?
.transfer(dest, 123_456_789_012_345)
.await?
.sign_and_submit(&signer, tx_params)
.await?;

Expand Down
3 changes: 2 additions & 1 deletion examples/examples/custom_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let hash = api
.tx()
.balances()
.transfer(dest, 10_000)?
.transfer(dest, 10_000)
.await?
.sign_and_submit_default(&signer)
.await?;

Expand Down
2 changes: 1 addition & 1 deletion examples/examples/metadata_compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
//
// To make sure that all of our statically generated pallets are compatible with the
// runtime node, we can run this check:
api.validate_metadata()?;
api.validate_metadata().await?;

Ok(())
}
9 changes: 6 additions & 3 deletions examples/examples/submit_and_watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ async fn simple_transfer() -> Result<(), Box<dyn std::error::Error>> {
let balance_transfer = api
.tx()
.balances()
.transfer(dest, 10_000)?
.transfer(dest, 10_000)
.await?
.sign_and_submit_then_watch_default(&signer)
.await?
.wait_for_finalized_success()
Expand Down Expand Up @@ -92,7 +93,8 @@ async fn simple_transfer_separate_events() -> Result<(), Box<dyn std::error::Err
let balance_transfer = api
.tx()
.balances()
.transfer(dest, 10_000)?
.transfer(dest, 10_000)
.await?
.sign_and_submit_then_watch_default(&signer)
.await?
.wait_for_finalized()
Expand Down Expand Up @@ -143,7 +145,8 @@ async fn handle_transfer_events() -> Result<(), Box<dyn std::error::Error>> {
let mut balance_transfer_progress = api
.tx()
.balances()
.transfer(dest, 10_000)?
.transfer(dest, 10_000)
.await?
.sign_and_submit_then_watch_default(&signer)
.await?;

Expand Down
1 change: 1 addition & 0 deletions examples/examples/subscribe_all_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
api.tx()
.balances()
.transfer(AccountKeyring::Bob.to_account_id().into(), transfer_amount)
.await
.expect("compatible transfer call on runtime node")
.sign_and_submit_default(&signer)
.await
Expand Down
1 change: 1 addition & 0 deletions examples/examples/subscribe_one_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
api.tx()
.balances()
.transfer(AccountKeyring::Bob.to_account_id().into(), 1_000_000_000)
.await
.expect("compatible transfer call on runtime node")
.sign_and_submit_default(&signer)
.await
Expand Down
1 change: 1 addition & 0 deletions examples/examples/subscribe_runtime_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
AccountKeyring::Bob.to_account_id().into(),
123_456_789_012_345,
)
.await
.unwrap()
.sign_and_submit_default(&signer)
.await
Expand Down
1 change: 1 addition & 0 deletions examples/examples/subscribe_some_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
api.tx()
.balances()
.transfer(AccountKeyring::Bob.to_account_id().into(), 1_000_000_000)
.await
.expect("compatible transfer call on runtime node")
.sign_and_submit_default(&signer)
.await
Expand Down
Loading

0 comments on commit 5423f6e

Please sign in to comment.