Skip to content

Commit

Permalink
Number of digits - check if the value can be updated on the runtime...
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Jasuwienas <[email protected]>
  • Loading branch information
arianejasuwienas committed Nov 26, 2024
1 parent 060f735 commit d2c2e76
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,41 @@ public MessageFrame buildInitialFrameWith(
final var ledgerConfig = config.getConfigData(LedgerConfig.class);
final var nominalCoinbase = asLongZeroAddress(ledgerConfig.fundingAccount());
final var contextVariables = contextVariablesFrom(config, context);
final var builder = MessageFrame.builder()
if (transaction.isCreate()) {
final var standardBuilder = MessageFrame.builder()
.maxStackSize(MAX_STACK_SIZE)
.worldUpdater(worldUpdater.updater())
.initialGas(transaction.gasAvailable(intrinsicGas))
.originator(from)
.gasPrice(Wei.of(context.gasPrice()))
.sender(from)
.value(Wei.of(1))
.apparentValue(Wei.of(1))
// .value(value)
// .apparentValue(value)
.value(value)
.apparentValue(value)
.blockValues(context.blockValuesOf(transaction.gasLimit()))
.completer(unused -> {})
.isStatic(context.staticCall())
.miningBeneficiary(nominalCoinbase)
.blockHashLookup(context.blocks()::blockHashOf)
.contextVariables(contextVariables);
if (transaction.isCreate()) {
return finishedAsCreate(to, builder, transaction);
return finishedAsCreate(to, standardBuilder, transaction);
} else {
final var fakeValueBuilder = MessageFrame.builder()
.maxStackSize(MAX_STACK_SIZE)
.worldUpdater(worldUpdater.updater())
.initialGas(transaction.gasAvailable(intrinsicGas))
.originator(from)
.gasPrice(Wei.of(context.gasPrice()))
.sender(from)
.value(Wei.of(1000_000_001L))
.apparentValue(Wei.of(1000_000_001L))
.blockValues(context.blockValuesOf(transaction.gasLimit()))
.completer(unused -> {})
.isStatic(context.staticCall())
.miningBeneficiary(nominalCoinbase)
.blockHashLookup(context.blocks()::blockHashOf)
.contextVariables(contextVariables);
return finishedAsCall(
to, worldUpdater, builder, transaction, featureFlags, config.getConfigData(ContractsConfig.class));
to, worldUpdater, fakeValueBuilder, transaction, featureFlags, config.getConfigData(ContractsConfig.class));
}
}

Expand Down

0 comments on commit d2c2e76

Please sign in to comment.