You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debugging resource-related issues and getting around bugs in the preflight flow.
What would you like to see?
CLI allows dev to set limits for a particular resource-type. The specified limits can be greater than the estimated cost. If preflight estimates 10M cpu insn for my transaction, allow me to set 20M.
Allow for setting limits of multiple resource types.
What alternatives are there?
Use the JS SDK:
// transactionData field from https://soroban.stellar.org/api/methods/simulateTransaction
const preflightResponse = /* base64 */
const txBuilder = /* ... some TransactionBuilder instance ... */
const tx = txBuilder.setSorobanData(
bumpCpuInstructions(preflightResponse, BUMP_FACTOR).build()
).build();
function bumpCpuInstructions(
preflight: string,
bumpFactor: number
): SorobanDataBuilder {
const sorobanData = new SorobanDataBuilder(preflight).build();
// get existing data
const [ cpuIns, rdBytes, wrBytes ] = [
sorobanData.resources().instructions(),
sorobanData.resources().readBytes(),
sorobanData.resources().writeBytes(),
];
return new SorobanDataBuilder(preflightResponse)
.setResources(cpuIns + bumpFactor, rdBytes, wrBytes);
}
The text was updated successfully, but these errors were encountered:
What problem does your feature solve?
Debugging resource-related issues and getting around bugs in the preflight flow.
What would you like to see?
What alternatives are there?
Use the JS SDK:
The text was updated successfully, but these errors were encountered: