Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ if ! [[ "$0" =~ scripts/build.sh ]]; then
exit 255
fi

SPACESVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SPACESVM_PATH"/scripts/constants.sh

# Set default binary directory location
name="sqja3uK17MJxfC7AN8nGadBw9JK5BcrsNwNynsqP5Gih8M5Bm"

Expand Down
7 changes: 7 additions & 0 deletions scripts/constants.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Set the CGO flags to use the portable version of BLST
#
# We use "export" here instead of just setting a bash variable because we need
# to pass this flag to all child processes spawned by the shell.
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
6 changes: 6 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ if ! [[ "$0" =~ scripts/run.sh ]]; then
exit 255
fi

SPACESVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SPACESVM_PATH"/scripts/constants.sh

VERSION=$1
if [[ -z "${VERSION}" ]]; then
echo "Missing version argument!"
Expand Down
6 changes: 6 additions & 0 deletions scripts/tests.integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ if ! [[ "$0" =~ scripts/tests.integration.sh ]]; then
exit 255
fi

SPACESVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SPACESVM_PATH"/scripts/constants.sh

# to install the ginkgo binary (required for test build and run)
go install -v github.com/onsi/ginkgo/v2/[email protected]

Expand Down
6 changes: 6 additions & 0 deletions scripts/tests.lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ if ! [[ "$0" =~ scripts/tests.lint.sh ]]; then
exit 255
fi

SPACESVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SPACESVM_PATH"/scripts/constants.sh

if [ "$#" -eq 0 ]; then
# by default, check all source code
# to test only "mempool" package
Expand Down
6 changes: 6 additions & 0 deletions scripts/tests.unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ if ! [[ "$0" =~ scripts/tests.unit.sh ]]; then
exit 255
fi

SPACESVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SPACESVM_PATH"/scripts/constants.sh

go test -race -timeout="3m" -coverprofile="coverage.out" -covermode="atomic" $(go list ./... | grep -v tests)