@@ -0,0 +1,2536 @@
+package org.bitcoinj.evolution;%0A%0Aimport org.bitcoinj.core.*;%0Aimport org.json.JSONObject;%0A%0Aimport java.io.IOException;%0Aimport java.io.OutputStream;%0A%0Apublic class SubTxTransition extends SubTxForExistingUser %7B%0A%0A    static final int CURRENT_VERSION = 1;%0A%0A    static final Coin EVO_TS_MIN_FEE = Coin.valueOf(1000); // TODO find good min fee%0A    static final Coin EVO_TS_MAX_FEE = EVO_TS_MIN_FEE.multiply(10); // TODO find good max fee%0A%0A%0A    Sha256Hash hashSTPacket;%0A%0A    public SubTxTransition(NetworkParameters params, Transaction tx) %7B%0A        super(params, tx);%0A    %7D%0A%0A    protected SubTxTransition(int version, Sha256Hash regTxId, Sha256Hash hashPrevSubTx, Coin creditFee, MasternodeSignature signature, Sha256Hash hashSTPacket) %7B%0A        super(version, regTxId, hashPrevSubTx, creditFee, signature);%0A        this.hashSTPacket = hashSTPacket;%0A    %7D%0A%0A    SubTxTransition duplicate() %7B%0A        SubTxTransition copy = new SubTxTransition(version, regTxId, hashPrevSubTx, creditFee, signature, hashSTPacket);%0A        return copy;%0A    %7D%0A%0A    @Override%0A    protected void parse() throws ProtocolException %7B%0A        super.parse();%0A        regTxId = readHash();%0A        hashPrevSubTx = readHash();%0A        creditFee = Coin.valueOf(readInt64());%0A        hashSTPacket = readHash();%0A        signature = new MasternodeSignature(params, payload, cursor);%0A        cursor += signature.getMessageSize();%0A        length = cursor - offset;%0A    %7D%0A%0A    @Override%0A    protected void bitcoinSerializeToStream(OutputStream stream) throws IOException %7B%0A        super.bitcoinSerializeToStream(stream);%0A        stream.write(regTxId.getReversedBytes());%0A        stream.write(hashPrevSubTx.getReversedBytes());%0A        Utils.int64ToByteStreamLE(creditFee.getValue(), stream);%0A        stream.write(hashSTPacket.getReversedBytes());%0A        signature.bitcoinSerialize(stream);%0A    %7D%0A%0A    public JSONObject toJson() %7B%0A        JSONObject result = new JSONObject();%0A        result.append(%22txType%22, getName());%0A        result.append(%22version%22, version);%0A        result.append(%22regTxId%22, regTxId);%0A        result.append(%22hashPrevSubTx%22, hashPrevSubTx);%0A        result.append(%22creditFee%22, creditFee);%0A        result.append(%22hashSTPacket%22, hashSTPacket);%0A%0A        return result;%0A    %7D%0A%0A    @Override%0A    public int getCurrentVersion() %7B return CURRENT_VERSION; %7D%0A%0A    @Override%0A    public Transaction.Type getType() %7B%0A        return Transaction.Type.TRANSACTION_SUBTX_TRANSITION;%0A    %7D%0A%0A    @Override%0A    public String getName() %7B%0A        return %22subTxTransition%22;%0A    %7D%0A%7D%0A

Add SubTxTransition for state transitions and fees