@@ -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); | ||||
} | } | ||||
@@ -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; | ||||
} | } | ||||
@@ -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(); | ||||
@@ -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(); | ||||
@@ -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 | ||||
@@ -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 | ||||