Search in sources :

Example 1 with SubstateStore

use of com.radixdlt.atom.SubstateStore in project radixdlt by radixdlt.

the class RadixEngine method construct.

private TxBuilder construct(TxBuilderExecutable executable, Set<SubstateId> avoid) throws TxBuilderException {
    synchronized (stateUpdateEngineLock) {
        SubstateStore filteredStore = new SubstateStore() {

            @Override
            public CloseableCursor<RawSubstateBytes> openIndexedCursor(SubstateIndex<?> index) {
                return engineStore.openIndexedCursor(index).filter(i -> !avoid.contains(SubstateId.fromBytes(i.getId())));
            }

            @Override
            public Optional<RawSubstateBytes> get(SystemMapKey key) {
                return engineStore.get(key);
            }
        };
        var txBuilder = TxBuilder.newBuilder(filteredStore, constraintMachine.getDeserialization(), serialization, maxMessageLen);
        executable.execute(txBuilder);
        return txBuilder;
    }
}
Also used : RawSubstateBytes(com.radixdlt.constraintmachine.RawSubstateBytes) SystemMapKey(com.radixdlt.constraintmachine.SystemMapKey) SubstateStore(com.radixdlt.atom.SubstateStore) SubstateIndex(com.radixdlt.constraintmachine.SubstateIndex)

Aggregations

SubstateStore (com.radixdlt.atom.SubstateStore)1 RawSubstateBytes (com.radixdlt.constraintmachine.RawSubstateBytes)1 SubstateIndex (com.radixdlt.constraintmachine.SubstateIndex)1 SystemMapKey (com.radixdlt.constraintmachine.SystemMapKey)1