Browse Source

distinguish operations for the browser

tags/1.1.0
zhangshuang 5 years ago
parent
commit
981892caf9
6 changed files with 15 additions and 15 deletions
  1. +2
    -2
      source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/ParticipantRegisterOperationHandle.java
  2. +1
    -1
      source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/ParticipantStateUpdateOperationHandle.java
  3. +1
    -1
      source/ledger/ledger-model/src/main/java/com/jd/blockchain/ledger/ParticipantRegisterOperation.java
  4. +1
    -1
      source/ledger/ledger-model/src/main/java/com/jd/blockchain/ledger/ParticipantStateUpdateOperation.java
  5. +5
    -5
      source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/ParticipantRegisterOpTemplate.java
  6. +5
    -5
      source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/ParticipantStateUpdateOpTemplate.java

+ 2
- 2
source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/ParticipantRegisterOperationHandle.java View File

@@ -39,7 +39,7 @@ public class ParticipantRegisterOperationHandle extends AbstractLedgerOperationH


LedgerAdminDataset adminAccountDataSet = newBlockDataset.getAdminDataset(); LedgerAdminDataset adminAccountDataSet = newBlockDataset.getAdminDataset();


ParticipantInfo participantInfo = new ParticipantInfoData(participantRegOp.getParticipantName(), participantRegOp.getParticipantIdentity().getPubKey(), participantRegOp.getNetworkAddress());
ParticipantInfo participantInfo = new ParticipantInfoData(participantRegOp.getParticipantName(), participantRegOp.getParticipantRegisterIdentity().getPubKey(), participantRegOp.getNetworkAddress());


ParticipantNode participantNode = new PartNode((int)(adminAccountDataSet.getParticipantCount()), participantInfo.getName(), participantInfo.getPubKey(), ParticipantNodeState.REGISTERED); ParticipantNode participantNode = new PartNode((int)(adminAccountDataSet.getParticipantCount()), participantInfo.getName(), participantInfo.getPubKey(), ParticipantNodeState.REGISTERED);


@@ -47,7 +47,7 @@ public class ParticipantRegisterOperationHandle extends AbstractLedgerOperationH
adminAccountDataSet.addParticipant(participantNode); adminAccountDataSet.addParticipant(participantNode);


// Build UserRegisterOperation, reg participant as user // Build UserRegisterOperation, reg participant as user
UserRegisterOperation userRegOp = new UserRegisterOpTemplate(participantRegOp.getParticipantIdentity());
UserRegisterOperation userRegOp = new UserRegisterOpTemplate(participantRegOp.getParticipantRegisterIdentity());
handleContext.handle(userRegOp); handleContext.handle(userRegOp);
} }




+ 1
- 1
source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/ParticipantStateUpdateOperationHandle.java View File

@@ -48,7 +48,7 @@ public class ParticipantStateUpdateOperationHandle extends AbstractLedgerOperati
ParticipantNode participantNode = null; ParticipantNode participantNode = null;


for(int i = 0; i < participants.length; i++) { for(int i = 0; i < participants.length; i++) {
if (stateUpdateOperation.getParticipantIdentity().getPubKey().equals(participants[i].getPubKey())) {
if (stateUpdateOperation.getStateUpdateIdentity().getPubKey().equals(participants[i].getPubKey())) {
participantNode = new PartNode(participants[i].getId(), participants[i].getName(), participants[i].getPubKey(), ParticipantNodeState.ACTIVED); participantNode = new PartNode(participants[i].getId(), participants[i].getName(), participants[i].getPubKey(), ParticipantNodeState.ACTIVED);
break; break;
} }


+ 1
- 1
source/ledger/ledger-model/src/main/java/com/jd/blockchain/ledger/ParticipantRegisterOperation.java View File

@@ -13,7 +13,7 @@ public interface ParticipantRegisterOperation extends Operation {
String getParticipantName(); String getParticipantName();


@DataField(order = 1, refContract = true) @DataField(order = 1, refContract = true)
BlockchainIdentity getParticipantIdentity();
BlockchainIdentity getParticipantRegisterIdentity();


@DataField(order = 2, primitiveType = PrimitiveType.BYTES) @DataField(order = 2, primitiveType = PrimitiveType.BYTES)
NetworkAddress getNetworkAddress(); NetworkAddress getNetworkAddress();


+ 1
- 1
source/ledger/ledger-model/src/main/java/com/jd/blockchain/ledger/ParticipantStateUpdateOperation.java View File

@@ -10,7 +10,7 @@ import com.jd.blockchain.utils.net.NetworkAddress;
public interface ParticipantStateUpdateOperation extends Operation { public interface ParticipantStateUpdateOperation extends Operation {


@DataField(order = 0, refContract = true) @DataField(order = 0, refContract = true)
BlockchainIdentity getParticipantIdentity();
BlockchainIdentity getStateUpdateIdentity();


@DataField(order = 1, primitiveType = PrimitiveType.BYTES) @DataField(order = 1, primitiveType = PrimitiveType.BYTES)
NetworkAddress getNetworkAddress(); NetworkAddress getNetworkAddress();


+ 5
- 5
source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/ParticipantRegisterOpTemplate.java View File

@@ -14,12 +14,12 @@ public class ParticipantRegisterOpTemplate implements ParticipantRegisterOperati
} }


private String participantName; private String participantName;
private BlockchainIdentity participantPubKey;
private BlockchainIdentity participantRegisterIdentity;
private NetworkAddress networkAddress; private NetworkAddress networkAddress;


public ParticipantRegisterOpTemplate(String participantName, BlockchainIdentity participantPubKey, NetworkAddress networkAddress) {
public ParticipantRegisterOpTemplate(String participantName, BlockchainIdentity participantRegisterIdentity, NetworkAddress networkAddress) {
this.participantName = participantName; this.participantName = participantName;
this.participantPubKey = participantPubKey;
this.participantRegisterIdentity = participantRegisterIdentity;
this.networkAddress = networkAddress; this.networkAddress = networkAddress;


} }
@@ -30,8 +30,8 @@ public class ParticipantRegisterOpTemplate implements ParticipantRegisterOperati
} }


@Override @Override
public BlockchainIdentity getParticipantIdentity() {
return participantPubKey;
public BlockchainIdentity getParticipantRegisterIdentity() {
return participantRegisterIdentity;
} }


@Override @Override


+ 5
- 5
source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/ParticipantStateUpdateOpTemplate.java View File

@@ -12,21 +12,21 @@ public class ParticipantStateUpdateOpTemplate implements ParticipantStateUpdateO
DataContractRegistry.register(ParticipantStateUpdateOperation.class); DataContractRegistry.register(ParticipantStateUpdateOperation.class);
} }


private BlockchainIdentity blockchainIdentity;
private BlockchainIdentity stateUpdateIdentity;
private NetworkAddress networkAddress; private NetworkAddress networkAddress;
private ParticipantNodeState participantNodeState; private ParticipantNodeState participantNodeState;


public ParticipantStateUpdateOpTemplate(BlockchainIdentity blockchainIdentity, NetworkAddress networkAddress, ParticipantNodeState participantNodeState) {
public ParticipantStateUpdateOpTemplate(BlockchainIdentity stateUpdateIdentity, NetworkAddress networkAddress, ParticipantNodeState participantNodeState) {


this.blockchainIdentity = blockchainIdentity;
this.stateUpdateIdentity = stateUpdateIdentity;
this.networkAddress = networkAddress; this.networkAddress = networkAddress;
this.participantNodeState = participantNodeState; this.participantNodeState = participantNodeState;
} }




@Override @Override
public BlockchainIdentity getParticipantIdentity() {
return blockchainIdentity;
public BlockchainIdentity getStateUpdateIdentity() {
return stateUpdateIdentity;
} }


@Override @Override


Loading…
Cancel
Save