-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
141 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/build_chain.sh && chmod u+x build_chain.sh | ||
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/ci/download_bin.sh) -b dev | ||
echo "127.0.0.1:4 agency1 1,2,3" > ipconf | ||
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0 | ||
./nodes/127.0.0.1/start_all.sh | ||
./nodes/127.0.0.1/fisco-bcos -v | ||
cp nodes/127.0.0.1/sdk/* src/integration-test/resources/ | ||
mv src/integration-test/resources/applicationContext-sample.xml src/integration-test/resources/applicationContext.xml | ||
./gradlew verifyGoogleJavaFormat | ||
./gradlew build | ||
./gradlew test | ||
./gradlew integrationTest |
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,52 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
scan_code_script="python ~/cobra/cobra.py -t " | ||
|
||
LOG_ERROR() { | ||
content=${1} | ||
echo -e "\033[31m${content}\033[0m" | ||
} | ||
|
||
LOG_INFO() { | ||
content=${1} | ||
echo -e "\033[32m${content}\033[0m" | ||
} | ||
|
||
execute_cmd() { | ||
command="${1}" | ||
eval ${command} | ||
ret=$? | ||
if [ $ret -ne 0 ];then | ||
LOG_ERROR "FAILED of command: ${command}" | ||
exit 1 | ||
else | ||
LOG_INFO "SUCCESS of command: ${command}" | ||
fi | ||
} | ||
|
||
scan_code() | ||
{ | ||
# Redirect output to stderr. | ||
exec 1>&2 | ||
for file in $(git diff-index --name-status HEAD^ | grep -v .ci | awk '{print $2}'); do | ||
execute_cmd "${scan_code_script} $file -f json -o /tmp/report.json" | ||
trigger_rules=$(jq -r '.' /tmp/report.json | grep 'trigger_rules' | awk '{print $2}' | sed 's/,//g') | ||
echo "trigger_rules is ${trigger_rules}" | ||
rm /tmp/report.json | ||
if [ ${trigger_rules} -ne 0 ]; then | ||
echo "######### ERROR: Scan code failed, please adjust them before commit" | ||
exit 1 | ||
fi | ||
done | ||
} | ||
|
||
install_cobra() { | ||
git clone https://github.com/WhaleShark-Team/cobra.git ~/cobra | ||
pip install -r ~/cobra/requirements.txt | ||
cp ~/cobra/config.template ~/cobra/config | ||
} | ||
|
||
install_cobra | ||
scan_code |
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
29 changes: 14 additions & 15 deletions
29
src/main/java/org/fisco/bcos/channel/protocol/EnumSocketChannelAttributeKey.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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
package org.fisco.bcos.channel.protocol; | ||
|
||
public enum EnumSocketChannelAttributeKey { | ||
|
||
CHANNEL_PROTOCOL_KEY("CHANNEL_PROTOCOL_KEY"), | ||
CHANNEL_CONNECTED_KEY("CHANNEL_CONNECTED_KEY"); | ||
|
||
private EnumSocketChannelAttributeKey(String key) { | ||
this.key = key; | ||
} | ||
|
||
private String key; | ||
CHANNEL_PROTOCOL_KEY("CHANNEL_PROTOCOL_KEY"), | ||
CHANNEL_CONNECTED_KEY("CHANNEL_CONNECTED_KEY"); | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
private EnumSocketChannelAttributeKey(String key) { | ||
this.key = key; | ||
} | ||
|
||
public void setKey(String key) { | ||
this.key = key; | ||
} | ||
private String key; | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public void setKey(String key) { | ||
this.key = key; | ||
} | ||
} |
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