Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Refactor Constraint Machine #172

Merged
merged 24 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
57d37c7
Cleanup signature verification
talekhinezh Apr 9, 2021
a87b601
Remove data pointer
talekhinezh Apr 9, 2021
4b19d6b
Rename isMutable
talekhinezh Apr 9, 2021
dd764c3
Merge remote-tracking branch 'origin/rc/1.0-beta.29' into feature/con…
talekhinezh Apr 9, 2021
e8fbaf8
Don't create UnallocatedParticle on burn
talekhinezh Apr 9, 2021
7c9e661
Cleanup error handling
talekhinezh Apr 11, 2021
005be4a
Remove unallocated tokens particle
talekhinezh Apr 11, 2021
19cfb71
consolidate burn action into a single method
talekhinezh Apr 11, 2021
f52a133
Parse transactions into actions
talekhinezh Apr 11, 2021
30ed4ad
Simplify Constraint Machine reducer
talekhinezh Apr 11, 2021
c2245dd
Rename compute to reducer
talekhinezh Apr 11, 2021
a0a2a51
Simplify ConstraintTransaction interface
talekhinezh Apr 12, 2021
2f5dd62
Cleanup output of reducer
talekhinezh Apr 12, 2021
6ef5018
Cleanup Constraint Machine logic
talekhinezh Apr 12, 2021
4546c89
Return parsed action
talekhinezh Apr 12, 2021
c0d2f7a
Refactor address parsing for transaction
talekhinezh Apr 12, 2021
ad3bb0d
Cleanup
talekhinezh Apr 12, 2021
1d85e80
Fix loading of actions in Client Api Store
talekhinezh Apr 12, 2021
6fdb360
Implement mint token action parsing
talekhinezh Apr 12, 2021
e1f373c
Implement amounts in token transfer and staking
talekhinezh Apr 12, 2021
acf528c
Cleanup TransactionParser
talekhinezh Apr 12, 2021
821eb2e
Use UInt384 for client side aggregation
talekhinezh Apr 12, 2021
cb8e73c
Fix fungible logic
talekhinezh Apr 13, 2021
dd1e5af
Merge remote-tracking branch 'origin/rc/1.0-beta.29' into feature/ref…
talekhinezh Apr 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,11 @@ subprojects {
tasks.named("checkstyleMain") {
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
exclude "**/org/radix/**/*.java"
exclude "**/examples/**/*.java"
}

tasks.named("checkstyleTest") {
configFile = rootProject.file('config/checkstyle/checkstyle_test.xml')
exclude "**/org/radix/**/*.java"
exclude "**/examples/**/*.java"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void processRequest(NodeApplicationRequest request) {
this.inflightRequests.put(txn.getId(), request);
this.mempoolAddEventDispatcher.dispatch(MempoolAdd.create(txn));
} catch (TxBuilderException e) {
log.error("Faucet failed to fulfil request {}", request);
log.error("Failed to fulfil request {} reason: {}", request, e.getMessage());
request.onFailure(null, e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@ public void onSuccess(Txn txn, AID aid) {
public void onFailure(Txn txn, String errorMessage) {
onError.accept(txn, errorMessage);
}

@Override
public String toString() {
return String.format("%s{%s}", this.getClass().getSimpleName(), this.actions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public EventProcessor<ScheduledMempoolFill> scheduledMempoolFillEventProcessor()

var actions = TxActionListBuilder.create()
.splitNative(nativeToken, fee.multiply(UInt256.TWO))
.burnNative(nativeToken, fee)
.burn(nativeToken, fee)
.build();

var shuttingDown = radixEngineMempool.getShuttingDownSubstates();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ private ActionEntry(ActionType type, RadixAddress from, RadixAddress to, UInt256

public static ActionEntry create(ActionType type, RadixAddress from, RadixAddress to, UInt256 amount, RRI rri) {
requireNonNull(type);
requireNonNull(from);
requireNonNull(to);
requireNonNull(amount);
requireNonNull(rri);
return new ActionEntry(type, from, to, amount, rri);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.radixdlt.identifiers.AID;
import com.radixdlt.identifiers.RRI;
import com.radixdlt.identifiers.RadixAddress;
import com.radixdlt.utils.UInt256;
import com.radixdlt.utils.UInt384;
import com.radixdlt.utils.functional.Result;

import java.time.Instant;
Expand Down Expand Up @@ -55,7 +55,7 @@ public interface ClientApiStore {
*
* @return eventually consistent token supply
*/
Result<UInt256> getTokenSupply(RRI rri);
Result<UInt384> getTokenSupply(RRI rri);

/**
* Retrieve token definition. Note that for mutable supply tokens supply is returned zero.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package com.radixdlt.client.store;

import com.radixdlt.constraintmachine.ParsedInstruction;
import com.radixdlt.constraintmachine.REParsedInstruction;
import com.radixdlt.constraintmachine.Particle;
import com.radixdlt.constraintmachine.Spin;

Expand All @@ -32,8 +32,8 @@ private ParticleWithSpin(Particle particle, Spin spin) {
this.spin = spin;
}

public static ParticleWithSpin create(ParsedInstruction instruction) {
return create(instruction.getParticle(), instruction.getSpin());
public static ParticleWithSpin create(REParsedInstruction instruction) {
return create(instruction.getParticle(), instruction.getNextSpin());
}

public static ParticleWithSpin up(Particle particle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.radixdlt.client.store;

import com.radixdlt.utils.UInt384;
import org.json.JSONObject;

import com.fasterxml.jackson.annotation.JsonCreator;
Expand All @@ -27,7 +28,6 @@
import com.radixdlt.serialization.SerializerConstants;
import com.radixdlt.serialization.SerializerDummy;
import com.radixdlt.serialization.SerializerId2;
import com.radixdlt.utils.UInt256;

import java.util.Objects;

Expand All @@ -47,15 +47,15 @@ public class TokenBalance {

@JsonProperty("amount")
@DsonOutput(DsonOutput.Output.ALL)
private final UInt256 amount;
private final UInt384 amount;

private TokenBalance(RRI rri, UInt256 amount) {
private TokenBalance(RRI rri, UInt384 amount) {
this.rri = rri;
this.amount = amount;
}

@JsonCreator
public static TokenBalance create(RRI rri, UInt256 amount) {
public static TokenBalance create(RRI rri, UInt384 amount) {
requireNonNull(rri);
requireNonNull(amount);

Expand All @@ -70,7 +70,7 @@ public RRI getRri() {
return rri;
}

public UInt256 getAmount() {
public UInt384 getAmount() {
return amount;
}

Expand Down
Loading