diff --git a/cmd/soroban-cli/src/rpc/mod.rs b/cmd/soroban-cli/src/rpc/mod.rs index 0e97964827..e817b2a38b 100644 --- a/cmd/soroban-cli/src/rpc/mod.rs +++ b/cmd/soroban-cli/src/rpc/mod.rs @@ -4,13 +4,13 @@ use jsonrpsee_core::params::ObjectParams; use jsonrpsee_core::{self, client::ClientT, rpc_params}; use jsonrpsee_http_client::{HeaderMap, HttpClient, HttpClientBuilder}; use serde_aux::prelude::{deserialize_default_from_null, deserialize_number_from_string}; -use soroban_env_host::xdr::DepthLimitedRead; use soroban_env_host::xdr::{ self, AccountEntry, AccountId, ContractDataEntry, DiagnosticEvent, Error as XdrError, LedgerEntryData, LedgerFootprint, LedgerKey, LedgerKeyAccount, PublicKey, ReadXdr, SorobanAuthorizationEntry, SorobanResources, Transaction, TransactionEnvelope, TransactionMeta, TransactionMetaV3, TransactionResult, TransactionV1Envelope, Uint256, VecM, WriteXdr, }; +use soroban_env_host::xdr::{DepthLimitedRead, SorobanAuthorizedFunction}; use soroban_sdk::token; use std::{ fmt::Display, @@ -662,7 +662,12 @@ soroban config identity fund {address} --helper-url "# sequence + 60, // ~5 minutes of ledgers network_passphrase, )?; - let (fee_ready_txn, events) = if signed_auth_entries.is_empty() { + let (fee_ready_txn, events) = if signed_auth_entries.is_empty() + || (signed_auth_entries.len() == 1 + && matches!( + signed_auth_entries[0].root_invocation.function, + SorobanAuthorizedFunction::CreateContractHostFn(_) + )) { (part_signed_tx, events) } else { // re-simulate to calculate the new fees diff --git a/cmd/soroban-rpc/internal/test/cli_test.go b/cmd/soroban-rpc/internal/test/cli_test.go index 91b5752761..6bd9a5a850 100644 --- a/cmd/soroban-rpc/internal/test/cli_test.go +++ b/cmd/soroban-rpc/internal/test/cli_test.go @@ -36,7 +36,7 @@ func TestCLIContractDeploy(t *testing.T) { func TestCLIContractInvokeWithWasm(t *testing.T) { NewCLITest(t) - output, err := runCLICommand(fmt.Sprintf("contract invoke --id 1 --wasm %s -- hello --world=world", helloWorldContractPath)) + output, err := runCLICommand(fmt.Sprintf("contract invoke --salt=0 --wasm %s -- hello --world=world", helloWorldContractPath)) assert.NoError(t, err) require.Contains(t, output, `["Hello","world"]`) }