From 223ce8ec3df82884253894d7cc69a40be6f488b8 Mon Sep 17 00:00:00 2001 From: soaresa <10797037+soaresa@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:16:00 -0300 Subject: [PATCH] cargo fmt --all && cargo clippy --workspace --tests --fix --- .../src/libra_framework_sdk_builder.rs | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/framework/cached-packages/src/libra_framework_sdk_builder.rs b/framework/cached-packages/src/libra_framework_sdk_builder.rs index 28fd901c4..a3bae1d52 100644 --- a/framework/cached-packages/src/libra_framework_sdk_builder.rs +++ b/framework/cached-packages/src/libra_framework_sdk_builder.rs @@ -2381,7 +2381,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::AccountOfferRotationCapability { - rotation_capability_sig_bytes: bcs::from_bytes(script.args().get(0)?).ok()?, + rotation_capability_sig_bytes: bcs::from_bytes(script.args().first()?).ok()?, account_scheme: bcs::from_bytes(script.args().get(1)?).ok()?, account_public_key_bytes: bcs::from_bytes(script.args().get(2)?).ok()?, recipient_address: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2396,7 +2396,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::AccountOfferSignerCapability { - signer_capability_sig_bytes: bcs::from_bytes(script.args().get(0)?).ok()?, + signer_capability_sig_bytes: bcs::from_bytes(script.args().first()?).ok()?, account_scheme: bcs::from_bytes(script.args().get(1)?).ok()?, account_public_key_bytes: bcs::from_bytes(script.args().get(2)?).ok()?, recipient_address: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2431,7 +2431,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::AccountRevokeRotationCapability { - to_be_revoked_address: bcs::from_bytes(script.args().get(0)?).ok()?, + to_be_revoked_address: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2443,7 +2443,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::AccountRevokeSignerCapability { - to_be_revoked_address: bcs::from_bytes(script.args().get(0)?).ok()?, + to_be_revoked_address: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2455,7 +2455,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::AccountRotateAuthenticationKey { - from_scheme: bcs::from_bytes(script.args().get(0)?).ok()?, + from_scheme: bcs::from_bytes(script.args().first()?).ok()?, from_public_key_bytes: bcs::from_bytes(script.args().get(1)?).ok()?, to_scheme: bcs::from_bytes(script.args().get(2)?).ok()?, to_public_key_bytes: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2473,7 +2473,7 @@ mod decoder { if let TransactionPayload::EntryFunction(script) = payload { Some( EntryFunctionCall::AccountRotateAuthenticationKeyWithRotationCapability { - rotation_cap_offerer_address: bcs::from_bytes(script.args().get(0)?).ok()?, + rotation_cap_offerer_address: bcs::from_bytes(script.args().first()?).ok()?, new_scheme: bcs::from_bytes(script.args().get(1)?).ok()?, new_public_key_bytes: bcs::from_bytes(script.args().get(2)?).ok()?, cap_update_table: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2487,7 +2487,7 @@ mod decoder { pub fn burn_set_send_community(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::BurnSetSendCommunity { - community: bcs::from_bytes(script.args().get(0)?).ok()?, + community: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2497,7 +2497,7 @@ mod decoder { pub fn code_publish_package_txn(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::CodePublishPackageTxn { - metadata_serialized: bcs::from_bytes(script.args().get(0)?).ok()?, + metadata_serialized: bcs::from_bytes(script.args().first()?).ok()?, code: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2508,8 +2508,8 @@ mod decoder { pub fn coin_transfer(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::CoinTransfer { - coin_type: script.ty_args().get(0)?.clone(), - to: bcs::from_bytes(script.args().get(0)?).ok()?, + coin_type: script.ty_args().first()?.clone(), + to: bcs::from_bytes(script.args().first()?).ok()?, amount: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2523,7 +2523,7 @@ mod decoder { if let TransactionPayload::EntryFunction(script) = payload { Some( EntryFunctionCall::CommunityWalletInitChangeSignerCommunityMultisig { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, new_signer: bcs::from_bytes(script.args().get(1)?).ok()?, is_add_operation: bcs::from_bytes(script.args().get(2)?).ok()?, n_of_m: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2540,7 +2540,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::CommunityWalletInitFinalizeAndCage { - num_signers: bcs::from_bytes(script.args().get(0)?).ok()?, + num_signers: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2552,7 +2552,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::CommunityWalletInitInitCommunity { - initial_authorities: bcs::from_bytes(script.args().get(0)?).ok()?, + initial_authorities: bcs::from_bytes(script.args().first()?).ok()?, check_threshold: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2565,7 +2565,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::CommunityWalletInitProposeOffer { - new_signers: bcs::from_bytes(script.args().get(0)?).ok()?, + new_signers: bcs::from_bytes(script.args().first()?).ok()?, num_signers: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2579,7 +2579,7 @@ mod decoder { if let TransactionPayload::EntryFunction(script) = payload { Some( EntryFunctionCall::DiemGovernanceAddApprovedScriptHashScript { - proposal_id: bcs::from_bytes(script.args().get(0)?).ok()?, + proposal_id: bcs::from_bytes(script.args().first()?).ok()?, }, ) } else { @@ -2592,7 +2592,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DiemGovernanceAssertCanResolve { - proposal_id: bcs::from_bytes(script.args().get(0)?).ok()?, + proposal_id: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2604,7 +2604,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DiemGovernanceCreateProposalV2 { - execution_hash: bcs::from_bytes(script.args().get(0)?).ok()?, + execution_hash: bcs::from_bytes(script.args().first()?).ok()?, metadata_location: bcs::from_bytes(script.args().get(1)?).ok()?, metadata_hash: bcs::from_bytes(script.args().get(2)?).ok()?, is_multi_step_proposal: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2619,7 +2619,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DiemGovernanceOlCreateProposalV2 { - execution_hash: bcs::from_bytes(script.args().get(0)?).ok()?, + execution_hash: bcs::from_bytes(script.args().first()?).ok()?, metadata_location: bcs::from_bytes(script.args().get(1)?).ok()?, metadata_hash: bcs::from_bytes(script.args().get(2)?).ok()?, is_multi_step_proposal: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2632,7 +2632,7 @@ mod decoder { pub fn diem_governance_ol_vote(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DiemGovernanceOlVote { - proposal_id: bcs::from_bytes(script.args().get(0)?).ok()?, + proposal_id: bcs::from_bytes(script.args().first()?).ok()?, should_pass: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2663,7 +2663,7 @@ mod decoder { pub fn diem_governance_vote(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DiemGovernanceVote { - proposal_id: bcs::from_bytes(script.args().get(0)?).ok()?, + proposal_id: bcs::from_bytes(script.args().first()?).ok()?, should_pass: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2676,7 +2676,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DonorVoiceTxsProposeLiquidateTx { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2688,7 +2688,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DonorVoiceTxsProposePaymentTx { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, payee: bcs::from_bytes(script.args().get(1)?).ok()?, value: bcs::from_bytes(script.args().get(2)?).ok()?, description: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2703,7 +2703,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DonorVoiceTxsProposeVetoTx { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, id: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2716,7 +2716,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DonorVoiceTxsVoteLiquidationTx { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2726,7 +2726,7 @@ mod decoder { pub fn donor_voice_txs_vote_veto_tx(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::DonorVoiceTxsVoteVetoTx { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, id: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2747,7 +2747,7 @@ mod decoder { pub fn jail_unjail_by_voucher(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::JailUnjailByVoucher { - addr: bcs::from_bytes(script.args().get(0)?).ok()?, + addr: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2769,7 +2769,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::LibraCoinDelegateMintCapability { - to: bcs::from_bytes(script.args().get(0)?).ok()?, + to: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2779,7 +2779,7 @@ mod decoder { pub fn libra_coin_mint_to_impl(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::LibraCoinMintToImpl { - dst_addr: bcs::from_bytes(script.args().get(0)?).ok()?, + dst_addr: bcs::from_bytes(script.args().first()?).ok()?, amount: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2790,7 +2790,7 @@ mod decoder { pub fn multi_action_claim_offer(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultiActionClaimOffer { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2812,7 +2812,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultiActionMigrationMigrateOffer { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2822,7 +2822,7 @@ mod decoder { pub fn multisig_account_add_owner(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountAddOwner { - new_owner: bcs::from_bytes(script.args().get(0)?).ok()?, + new_owner: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2832,7 +2832,7 @@ mod decoder { pub fn multisig_account_add_owners(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountAddOwners { - new_owners: bcs::from_bytes(script.args().get(0)?).ok()?, + new_owners: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2844,7 +2844,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountApproveTransaction { - multisig_account: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_account: bcs::from_bytes(script.args().first()?).ok()?, sequence_number: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2855,7 +2855,7 @@ mod decoder { pub fn multisig_account_create(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountCreate { - num_signatures_required: bcs::from_bytes(script.args().get(0)?).ok()?, + num_signatures_required: bcs::from_bytes(script.args().first()?).ok()?, metadata_keys: bcs::from_bytes(script.args().get(1)?).ok()?, metadata_values: bcs::from_bytes(script.args().get(2)?).ok()?, }) @@ -2869,7 +2869,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountCreateTransaction { - multisig_account: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_account: bcs::from_bytes(script.args().first()?).ok()?, payload: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2883,7 +2883,7 @@ mod decoder { if let TransactionPayload::EntryFunction(script) = payload { Some( EntryFunctionCall::MultisigAccountCreateTransactionWithHash { - multisig_account: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_account: bcs::from_bytes(script.args().first()?).ok()?, payload_hash: bcs::from_bytes(script.args().get(1)?).ok()?, }, ) @@ -2898,7 +2898,7 @@ mod decoder { if let TransactionPayload::EntryFunction(script) = payload { Some( EntryFunctionCall::MultisigAccountCreateWithExistingAccount { - multisig_address: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_address: bcs::from_bytes(script.args().first()?).ok()?, owners: bcs::from_bytes(script.args().get(1)?).ok()?, num_signatures_required: bcs::from_bytes(script.args().get(2)?).ok()?, account_scheme: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2919,7 +2919,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountCreateWithOwners { - additional_owners: bcs::from_bytes(script.args().get(0)?).ok()?, + additional_owners: bcs::from_bytes(script.args().first()?).ok()?, num_signatures_required: bcs::from_bytes(script.args().get(1)?).ok()?, metadata_keys: bcs::from_bytes(script.args().get(2)?).ok()?, metadata_values: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2935,7 +2935,7 @@ mod decoder { if let TransactionPayload::EntryFunction(script) = payload { Some( EntryFunctionCall::MultisigAccountExecuteRejectedTransaction { - multisig_account: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_account: bcs::from_bytes(script.args().first()?).ok()?, }, ) } else { @@ -2948,7 +2948,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountMigrateWithOwners { - additional_owners: bcs::from_bytes(script.args().get(0)?).ok()?, + additional_owners: bcs::from_bytes(script.args().first()?).ok()?, num_signatures_required: bcs::from_bytes(script.args().get(1)?).ok()?, metadata_keys: bcs::from_bytes(script.args().get(2)?).ok()?, metadata_values: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -2963,7 +2963,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountRejectTransaction { - multisig_account: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_account: bcs::from_bytes(script.args().first()?).ok()?, sequence_number: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -2976,7 +2976,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountRemoveOwner { - owner_to_remove: bcs::from_bytes(script.args().get(0)?).ok()?, + owner_to_remove: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -2988,7 +2988,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountRemoveOwners { - owners_to_remove: bcs::from_bytes(script.args().get(0)?).ok()?, + owners_to_remove: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3000,7 +3000,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountUpdateMetadata { - keys: bcs::from_bytes(script.args().get(0)?).ok()?, + keys: bcs::from_bytes(script.args().first()?).ok()?, values: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -3013,7 +3013,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountUpdateSignaturesRequired { - new_num_signatures_required: bcs::from_bytes(script.args().get(0)?).ok()?, + new_num_signatures_required: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3025,7 +3025,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountVoteTransanction { - multisig_account: bcs::from_bytes(script.args().get(0)?).ok()?, + multisig_account: bcs::from_bytes(script.args().first()?).ok()?, sequence_number: bcs::from_bytes(script.args().get(1)?).ok()?, approved: bcs::from_bytes(script.args().get(2)?).ok()?, }) @@ -3037,7 +3037,7 @@ mod decoder { pub fn object_transfer_call(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::ObjectTransferCall { - object: bcs::from_bytes(script.args().get(0)?).ok()?, + object: bcs::from_bytes(script.args().first()?).ok()?, to: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -3048,7 +3048,7 @@ mod decoder { pub fn ol_account_create_account(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::OlAccountCreateAccount { - auth_key: bcs::from_bytes(script.args().get(0)?).ok()?, + auth_key: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3060,7 +3060,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::OlAccountSetAllowDirectCoinTransfers { - allow: bcs::from_bytes(script.args().get(0)?).ok()?, + allow: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3070,7 +3070,7 @@ mod decoder { pub fn ol_account_transfer(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::OlAccountTransfer { - to: bcs::from_bytes(script.args().get(0)?).ok()?, + to: bcs::from_bytes(script.args().first()?).ok()?, amount: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -3097,7 +3097,7 @@ mod decoder { pub fn proof_of_fee_pof_update_bid(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::ProofOfFeePofUpdateBid { - bid: bcs::from_bytes(script.args().get(0)?).ok()?, + bid: bcs::from_bytes(script.args().first()?).ok()?, epoch_expiry: bcs::from_bytes(script.args().get(1)?).ok()?, }) } else { @@ -3108,7 +3108,7 @@ mod decoder { pub fn safe_init_payment_multisig(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::SafeInitPaymentMultisig { - authorities: bcs::from_bytes(script.args().get(0)?).ok()?, + authorities: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3120,7 +3120,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::SlowWalletSmokeTestVmUnlock { - user_addr: bcs::from_bytes(script.args().get(0)?).ok()?, + user_addr: bcs::from_bytes(script.args().first()?).ok()?, unlocked: bcs::from_bytes(script.args().get(1)?).ok()?, transferred: bcs::from_bytes(script.args().get(2)?).ok()?, }) @@ -3140,7 +3140,7 @@ mod decoder { pub fn stake_initialize_validator(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::StakeInitializeValidator { - consensus_pubkey: bcs::from_bytes(script.args().get(0)?).ok()?, + consensus_pubkey: bcs::from_bytes(script.args().first()?).ok()?, proof_of_possession: bcs::from_bytes(script.args().get(1)?).ok()?, network_addresses: bcs::from_bytes(script.args().get(2)?).ok()?, fullnode_addresses: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -3153,7 +3153,7 @@ mod decoder { pub fn stake_rotate_consensus_key(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::StakeRotateConsensusKey { - validator_address: bcs::from_bytes(script.args().get(0)?).ok()?, + validator_address: bcs::from_bytes(script.args().first()?).ok()?, new_consensus_pubkey: bcs::from_bytes(script.args().get(1)?).ok()?, proof_of_possession: bcs::from_bytes(script.args().get(2)?).ok()?, }) @@ -3167,7 +3167,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::StakeUpdateNetworkAndFullnodeAddresses { - validator_address: bcs::from_bytes(script.args().get(0)?).ok()?, + validator_address: bcs::from_bytes(script.args().first()?).ok()?, new_network_addresses: bcs::from_bytes(script.args().get(1)?).ok()?, new_fullnode_addresses: bcs::from_bytes(script.args().get(2)?).ok()?, }) @@ -3181,7 +3181,7 @@ mod decoder { ) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::ValidatorUniverseRegisterValidator { - consensus_pubkey: bcs::from_bytes(script.args().get(0)?).ok()?, + consensus_pubkey: bcs::from_bytes(script.args().first()?).ok()?, proof_of_possession: bcs::from_bytes(script.args().get(1)?).ok()?, network_addresses: bcs::from_bytes(script.args().get(2)?).ok()?, fullnode_addresses: bcs::from_bytes(script.args().get(3)?).ok()?, @@ -3194,7 +3194,7 @@ mod decoder { pub fn version_set_version(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::VersionSetVersion { - major: bcs::from_bytes(script.args().get(0)?).ok()?, + major: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3204,7 +3204,7 @@ mod decoder { pub fn vouch_insist_vouch_for(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::VouchInsistVouchFor { - friend_account: bcs::from_bytes(script.args().get(0)?).ok()?, + friend_account: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3214,7 +3214,7 @@ mod decoder { pub fn vouch_revoke(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::VouchRevoke { - friend_account: bcs::from_bytes(script.args().get(0)?).ok()?, + friend_account: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None @@ -3224,7 +3224,7 @@ mod decoder { pub fn vouch_vouch_for(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::VouchVouchFor { - friend_account: bcs::from_bytes(script.args().get(0)?).ok()?, + friend_account: bcs::from_bytes(script.args().first()?).ok()?, }) } else { None