From 6176d3146b0b931e7b17be1a1cbf2e4ae9a74dc0 Mon Sep 17 00:00:00 2001 From: tamirms Date: Wed, 6 Dec 2023 09:50:15 +0000 Subject: [PATCH] fix integration tests --- cmd/soroban-rpc/internal/test/simulate_transaction_test.go | 6 +++--- cmd/soroban-rpc/lib/preflight/src/fees.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/soroban-rpc/internal/test/simulate_transaction_test.go b/cmd/soroban-rpc/internal/test/simulate_transaction_test.go index 08f934a14..22a88487e 100644 --- a/cmd/soroban-rpc/internal/test/simulate_transaction_test.go +++ b/cmd/soroban-rpc/internal/test/simulate_transaction_test.go @@ -232,11 +232,11 @@ func TestSimulateTransactionSucceeds(t *testing.T) { }, }, }, - Instructions: 6262706, + Instructions: 4378462, ReadBytes: 0, WriteBytes: 7048, }, - ResourceFee: 130498, + ResourceFee: 113910, } // First, decode and compare the transaction data so we get a decent diff if it fails. @@ -1122,7 +1122,7 @@ func TestSimulateSystemEvent(t *testing.T) { require.NoError(t, err) assert.InDelta(t, 7464, uint32(transactionData.Resources.ReadBytes), 200) - assert.InDelta(t, 98339, int64(transactionData.ResourceFee), 2000) + assert.InDelta(t, 78927, int64(transactionData.ResourceFee), 2000) assert.InDelta(t, 104, uint32(transactionData.Resources.WriteBytes), 15) require.GreaterOrEqual(t, len(response.Events), 3) } diff --git a/cmd/soroban-rpc/lib/preflight/src/fees.rs b/cmd/soroban-rpc/lib/preflight/src/fees.rs index fe4c5f2fb..1cad9c975 100644 --- a/cmd/soroban-rpc/lib/preflight/src/fees.rs +++ b/cmd/soroban-rpc/lib/preflight/src/fees.rs @@ -142,7 +142,7 @@ fn calculate_host_function_soroban_resources( let budget_instructions = budget .get_cpu_insns_consumed() .context("cannot get instructions consumed")?; - let instructions = max(budget_instructions + 800000, budget_instructions * 120 / 100); + let instructions = max(budget_instructions + 1000000, budget_instructions * 120 / 100); Ok(SorobanResources { footprint: ledger_footprint, instructions: u32::try_from(instructions)?,