Search in sources :

Example 1 with SubstateOperation

use of com.radixdlt.api.core.model.SubstateOperation in project radixdlt by radixdlt.

the class RecoverableSubstateVirtualShutdown method recover.

@Override
public SubstateOperation recover(Provider<RadixEngine<LedgerAndBFTProof>> radixEngineProvider) {
    var radixEngine = radixEngineProvider.get();
    var keyBuf = substateId.getVirtualKey().orElseThrow();
    Particle substate;
    try {
        substate = radixEngine.getVirtualSubstateDeserialization().keyToSubstate(typeByte, keyBuf);
    } catch (DeserializeException e) {
        throw new IllegalStateException("Could not deserialize virtual substate.");
    }
    return new SubstateOperation(substate, substateId, false);
}
Also used : Particle(com.radixdlt.constraintmachine.Particle) SubstateOperation(com.radixdlt.api.core.model.SubstateOperation) DeserializeException(com.radixdlt.serialization.DeserializeException)

Aggregations

SubstateOperation (com.radixdlt.api.core.model.SubstateOperation)1 Particle (com.radixdlt.constraintmachine.Particle)1 DeserializeException (com.radixdlt.serialization.DeserializeException)1