Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Dec 6, 2023
1 parent 3c22cc4 commit 6176d31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/soroban-rpc/internal/test/simulate_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/lib/preflight/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?,
Expand Down

0 comments on commit 6176d31

Please sign in to comment.