Skip to content

Commit

Permalink
Merge pull request #148 from skalenetwork/enhancement/fix-tools-test
Browse files Browse the repository at this point in the history
add tools to nightly tests
  • Loading branch information
olehnikolaiev authored Jul 21, 2021
2 parents 2c70212 + 0373116 commit dcda5e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# ./test.sh
# cd ..

# - name: Run tools tests
# run: |
# ./scripts/run_tools_test.sh
- name: Run tools tests
run: |
./scripts/run_tools_test.sh
12 changes: 7 additions & 5 deletions scripts/run_tools_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ calculate_hash() {
}

run_tools_test_with_individual_keys() {
individual_dkg_keys=""
individual_dkg_keys="./dkg_glue --t 11 --n 16"
for i in {0..15}
do
individual_dkg_keys="$individual_dkg_keys --input data_for_$i-th_participant.json"
individual_dkg_keys=""$individual_dkg_keys" --input data_for_"$i"-th_participant.json"
./dkg_keygen --t 11 --n 16 --j "$i"
done
echo "Generated individual dkg keys"
./dkg_glue --t 11 --n 16 "$individual_dkg_keys"
echo "$individual_dkg_keys"
echo "./dkg_glue --t 11 --n 16 "$individual_dkg_keys""
$individual_dkg_keys
echo "Generated individual bls keys"

calculate_hash
Expand All @@ -47,13 +49,13 @@ run_tools_test_with_individual_keys() {
done
echo "Completed individual signatures and verified them"

individual_signatures=""
individual_signatures="./bls_glue --t 11 --n 16 "
for i in {0..10}
do
SIGNATURE="signature"$i".json"
individual_signatures="$individual_signatures --input $SIGNATURE"
done
./bls_glue --t 11 --n 16 "$individual_signatures" --output "$SIGNATURE_FILE"
$individual_signatures --output "$SIGNATURE_FILE"
echo "Generated common bls signature"

./verify_bls --t 11 --n 16 --input "$SIGNATURE_FILE"
Expand Down
2 changes: 1 addition & 1 deletion tools/bls_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with libBLS. If not, see <https://www.gnu.org/licenses/>.
along with libBLS. If not, see <https://www.gnu.org/licenses/>.
@file bls_glue.cpp
@author Oleh Nikolaiev
Expand Down
3 changes: 1 addition & 2 deletions tools/dkg_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with libBLS. If not, see <https://www.gnu.org/licenses/>.
along with libBLS. If not, see <https://www.gnu.org/licenses/>.
@file dkg_glue.cpp
@author Oleh Nikolaiev
Expand Down Expand Up @@ -52,7 +52,6 @@ void GenerateSecretKeys( const size_t t, const size_t n, const std::vector< std:

size_t idx = stoi( data["idx"].get< std::string >() );


secret_key_contribution[idx].resize( n );
for ( size_t i = 0; i < n; ++i ) {
secret_key_contribution[idx][i] = libff::alt_bn128_Fr(
Expand Down

0 comments on commit dcda5e9

Please sign in to comment.