From 8fdfe29b716fb3ddcca2d70f03a0445ac1da0386 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Tue, 3 Oct 2023 09:21:57 -0700 Subject: [PATCH] refactor: use query/update rather than query_/update_ --- .../ic-asset/src/canister_api/methods/api_version.rs | 2 +- .../ic-asset/src/canister_api/methods/asset_properties.rs | 2 +- .../frontend/ic-asset/src/canister_api/methods/batch.rs | 6 +++--- .../frontend/ic-asset/src/canister_api/methods/chunk.rs | 2 +- .../frontend/ic-asset/src/canister_api/methods/list.rs | 2 +- src/canisters/frontend/icx-asset/src/commands/list.rs | 2 +- src/dfx/src/commands/canister/call.rs | 4 ++-- src/dfx/src/commands/wallet/mod.rs | 4 ++-- src/dfx/src/lib/operations/canister/mod.rs | 2 +- src/dfx/src/lib/operations/ledger.rs | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/canisters/frontend/ic-asset/src/canister_api/methods/api_version.rs b/src/canisters/frontend/ic-asset/src/canister_api/methods/api_version.rs index 235a221787..b882c1e255 100644 --- a/src/canisters/frontend/ic-asset/src/canister_api/methods/api_version.rs +++ b/src/canisters/frontend/ic-asset/src/canister_api/methods/api_version.rs @@ -4,7 +4,7 @@ use ic_utils::Canister; pub(crate) async fn api_version(canister: &Canister<'_>) -> u16 { canister - .query_(API_VERSION) + .query(API_VERSION) .build() .call() .await diff --git a/src/canisters/frontend/ic-asset/src/canister_api/methods/asset_properties.rs b/src/canisters/frontend/ic-asset/src/canister_api/methods/asset_properties.rs index a0fda24559..4efdd1c8da 100644 --- a/src/canisters/frontend/ic-asset/src/canister_api/methods/asset_properties.rs +++ b/src/canisters/frontend/ic-asset/src/canister_api/methods/asset_properties.rs @@ -49,7 +49,7 @@ pub(crate) async fn get_asset_properties( asset_id: &str, ) -> Result { let (asset_properties,): (AssetProperties,) = canister - .query_(GET_ASSET_PROPERTIES) + .query(GET_ASSET_PROPERTIES) .with_arg(GetAssetPropertiesArgument(asset_id.to_string())) .build() .call() diff --git a/src/canisters/frontend/ic-asset/src/canister_api/methods/batch.rs b/src/canisters/frontend/ic-asset/src/canister_api/methods/batch.rs index db4ad8d6f5..db0296f75a 100644 --- a/src/canisters/frontend/ic-asset/src/canister_api/methods/batch.rs +++ b/src/canisters/frontend/ic-asset/src/canister_api/methods/batch.rs @@ -24,7 +24,7 @@ pub(crate) async fn create_batch(canister: &Canister<'_>) -> Result( loop { match canister - .update_(method_name) + .update(method_name) .with_arg(&arg) .build() .call_and_wait() @@ -103,7 +103,7 @@ pub(crate) async fn compute_evidence( loop { match canister - .update_(COMPUTE_EVIDENCE) + .update(COMPUTE_EVIDENCE) .with_arg(arg) .build() .map(|result: (Option,)| (result.0,)) diff --git a/src/canisters/frontend/ic-asset/src/canister_api/methods/chunk.rs b/src/canisters/frontend/ic-asset/src/canister_api/methods/chunk.rs index 8fab2c9045..ad55aab8eb 100644 --- a/src/canisters/frontend/ic-asset/src/canister_api/methods/chunk.rs +++ b/src/canisters/frontend/ic-asset/src/canister_api/methods/chunk.rs @@ -26,7 +26,7 @@ pub(crate) async fn create_chunk( .build(); loop { - let builder = canister.update_(CREATE_CHUNK); + let builder = canister.update(CREATE_CHUNK); let builder = builder.with_arg(&args); let request_id_result = { let _releaser = semaphores.create_chunk_call.acquire(1).await; diff --git a/src/canisters/frontend/ic-asset/src/canister_api/methods/list.rs b/src/canisters/frontend/ic-asset/src/canister_api/methods/list.rs index 1d7734e35b..321e30b34c 100644 --- a/src/canisters/frontend/ic-asset/src/canister_api/methods/list.rs +++ b/src/canisters/frontend/ic-asset/src/canister_api/methods/list.rs @@ -9,7 +9,7 @@ pub(crate) async fn list_assets( canister: &Canister<'_>, ) -> Result, AgentError> { let (entries,): (Vec,) = canister - .query_(LIST) + .query(LIST) .with_arg(ListAssetsRequest {}) .build() .call() diff --git a/src/canisters/frontend/icx-asset/src/commands/list.rs b/src/canisters/frontend/icx-asset/src/commands/list.rs index 50ee387c86..5bbddd014b 100644 --- a/src/canisters/frontend/icx-asset/src/commands/list.rs +++ b/src/canisters/frontend/icx-asset/src/commands/list.rs @@ -26,7 +26,7 @@ pub async fn list(canister: &Canister<'_>, logger: &Logger) -> anyhow::Result<() struct EmptyRecord {} let (entries,): (Vec,) = canister - .query_("list") + .query("list") .with_arg(EmptyRecord {}) .build() .call() diff --git a/src/dfx/src/commands/canister/call.rs b/src/dfx/src/commands/canister/call.rs index b4ab44dd6e..eb034120f6 100644 --- a/src/dfx/src/commands/canister/call.rs +++ b/src/dfx/src/commands/canister/call.rs @@ -94,7 +94,7 @@ struct CallIn { async fn do_wallet_call(wallet: &WalletCanister<'_>, args: &CallIn) -> DfxResult> { // todo change to wallet.call when IDLValue implements ArgumentDecoder let builder = if wallet.version_supports_u128_cycles() { - wallet.update_("wallet_call128").with_arg(args) + wallet.update("wallet_call128").with_arg(args) } else { let CallIn { canister, @@ -108,7 +108,7 @@ async fn do_wallet_call(wallet: &WalletCanister<'_>, args: &CallIn) -> DfxResult args, cycles: cycles as u64, }; - wallet.update_("wallet_call").with_arg(args64) + wallet.update("wallet_call").with_arg(args64) }; let (result,): (Result,) = builder .build() diff --git a/src/dfx/src/commands/wallet/mod.rs b/src/dfx/src/commands/wallet/mod.rs index 0eb1a95564..bbc2538f4f 100644 --- a/src/dfx/src/commands/wallet/mod.rs +++ b/src/dfx/src/commands/wallet/mod.rs @@ -92,7 +92,7 @@ where let wallet = get_or_create_wallet_canister(env, network, &identity_name).await?; let out: O = wallet - .query_(method) + .query(method) .with_arg(arg) .build() .call() @@ -109,7 +109,7 @@ where { let wallet = get_wallet(env).await?; let out: O = wallet - .update_(method) + .update(method) .with_arg(arg) .build() .call_and_wait() diff --git a/src/dfx/src/lib/operations/canister/mod.rs b/src/dfx/src/lib/operations/canister/mod.rs index e07682c574..0d7595690e 100644 --- a/src/dfx/src/lib/operations/canister/mod.rs +++ b/src/dfx/src/lib/operations/canister/mod.rs @@ -49,7 +49,7 @@ where CallSender::SelectedId => { let mgr = ManagementCanister::create(agent); - mgr.update_(method) + mgr.update(method) .with_arg(arg) .with_effective_canister_id(destination_canister) .build() diff --git a/src/dfx/src/lib/operations/ledger.rs b/src/dfx/src/lib/operations/ledger.rs index f3f360d740..c5206bf173 100644 --- a/src/dfx/src/lib/operations/ledger.rs +++ b/src/dfx/src/lib/operations/ledger.rs @@ -36,7 +36,7 @@ pub async fn balance( .with_canister_id(canister_id) .build()?; let (result,) = canister - .query_(ACCOUNT_BALANCE_METHOD) + .query(ACCOUNT_BALANCE_METHOD) .with_arg(AccountBalanceArgs { account: acct.to_string(), }) @@ -53,7 +53,7 @@ pub async fn xdr_permyriad_per_icp(agent: &Agent) -> DfxResult { .with_canister_id(MAINNET_CYCLE_MINTER_CANISTER_ID) .build()?; let (certified_rate,): (IcpXdrConversionRateCertifiedResponse,) = canister - .query_("get_icp_xdr_conversion_rate") + .query("get_icp_xdr_conversion_rate") .build() .call() .await?;