-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from WeBankBlockchain/feature/reconstruction
release 3.1.0-rc.1
- Loading branch information
Showing
121 changed files
with
5,101 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.0-rc.1 | ||
3.1.0-rc.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
org.gradle.jvmargs='-Dfile.encoding=UTF-8' | ||
jdkTlsNamedGroups=secp256r1,secp256k1 | ||
repoType=cn | ||
signing.keyId= | ||
signing.password= | ||
signing.secretKeyRingFile= | ||
sonatypeUsername= | ||
sonatypePassword= | ||
repoType=zn | ||
signing.keyId=62A32F80 | ||
signing.password=weidentity@123 | ||
signing.secretKeyRingFile=./secring.gpg | ||
sonatypeUsername=tonychen | ||
sonatypePassword=Abcd1234!@#$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/main/java/com/webank/weid/protocol/base/GlobalStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package com.webank.weid.protocol.base; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.webank.weid.blockchain.protocol.inf.JsonSerializer; | ||
import com.webank.weid.contract.deploy.AddressProcess; | ||
import lombok.Data; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.OutputStreamWriter; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
|
||
/** | ||
* The class of global status for running locally with database. | ||
* | ||
* @author afeexian | ||
*/ | ||
@Data | ||
public class GlobalStatus implements JsonSerializer { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(GlobalStatus.class); | ||
|
||
private int authority_issuer_current_cpt_id = 1000; | ||
|
||
private int none_authority_issuer_current_cpt_id = 2000000; | ||
|
||
private int authority_issuer_current_policy_id = 1000; | ||
|
||
private int none_authority_issuer_current_policy_id = 2000000; | ||
|
||
private int presentationId = 1; | ||
|
||
//TODO:给文件加锁 | ||
public static void storeStatusToFile(GlobalStatus globalStatus, String fileName) { | ||
try { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
File file = new File(fileName); | ||
// if file does not exists, then create it | ||
if (!file.exists()) { | ||
file.createNewFile(); | ||
} | ||
mapper.writeValue(file, globalStatus); | ||
} catch (IOException e) { | ||
logger.error("writer file exception", e); | ||
} | ||
} | ||
|
||
public static GlobalStatus readStatusFromFile(String fileName) { | ||
try { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
File file = new File(fileName); | ||
// if file does not exists, then create it | ||
if (file.exists()) { | ||
return mapper.readValue(file, GlobalStatus.class); | ||
} | ||
file.createNewFile(); | ||
return new GlobalStatus(); | ||
} catch (IOException e) { | ||
logger.error("writer file exception", e); | ||
} | ||
logger.error("readStatusFromFile() the {} does not exists.", fileName); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.