Skip to content

Commit

Permalink
dex/testing: Set short htlc locktimes for testing on simnet. (#3036)
Browse files Browse the repository at this point in the history
* dex/testing: Set short htlc locktimes for testing on simnet.

	walletpair simnet only: taker 3m, maker 6m
	dcrdex (simnet):        taker 3m, maker 6m

* dex/testing: Alternate lock times build script defaults changed

	build_lock defaults:
		Maker - 2m
		Taker - 1m

---------

Co-authored-by: dev-warrior777 <>
  • Loading branch information
dev-warrior777 authored Oct 27, 2024
1 parent 017099c commit 199dbcb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 5 additions & 4 deletions dex/testing/dcrdex/harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ cat > "${DCRDEX_DATA_DIR}/build" <<EOF
#!/usr/bin/env bash
cd ${HARNESS_DIR}/../../../server/cmd/dcrdex/
go build -o ${DCRDEX_DATA_DIR}/dcrdex -ldflags \
"-X 'decred.org/dcrdex/dex.testLockTimeTaker=1m' \
-X 'decred.org/dcrdex/dex.testLockTimeMaker=2m'"
"-X 'decred.org/dcrdex/dex.testLockTimeTaker=3m' \
-X 'decred.org/dcrdex/dex.testLockTimeMaker=6m'"
EOF
chmod +x "${DCRDEX_DATA_DIR}/build"

# Alternate lock times build script as a harness control
cat > "${DCRDEX_DATA_DIR}/build-lock" <<EOF
#!/usr/bin/env bash
cd ${HARNESS_DIR}/../../../server/cmd/dcrdex/
go build -o ${DCRDEX_DATA_DIR}/dcrdex -ldflags \
"-X 'decred.org/dcrdex/dex.testLockTimeTaker=\${1:-3m}' \
-X 'decred.org/dcrdex/dex.testLockTimeMaker=\${2:-6m}'"
"-X 'decred.org/dcrdex/dex.testLockTimeTaker=\${1:-1m}' \
-X 'decred.org/dcrdex/dex.testLockTimeMaker=\${2:-2m}'"
EOF
chmod +x "${DCRDEX_DATA_DIR}/build-lock"

Expand Down
10 changes: 8 additions & 2 deletions dex/testing/walletpair/walletpair.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ while [ "${1:-}" != "" ]; do
shift
done

if [ "$SIMNET" ] ; then
if [ "${SIMNET}" ] ; then
PAIR_ROOT=~/dextest/simnet-walletpair
CLIENT_1_ADDR="127.0.0.6:5760"
CLIENT_1_RPC_ADDR="127.0.0.6:5761"
Expand All @@ -57,7 +57,13 @@ BW_DIR=$(realpath ../../../client/cmd/bisonw)
BISONW="${BW_DIR}/bisonw"

cd "${BW_DIR}"
go build
if [ "${SIMNET}" ] ; then
echo "building bisonw for simnet - lock times: taker 3m, maker 6m"
go build -ldflags "-X decred.org/dcrdex/dex.testLockTimeTaker=3m \
-X decred.org/dcrdex/dex.testLockTimeMaker=6m"
else
go build
fi
cd -

mkdir -p "${HARNESS_DIR}"
Expand Down

0 comments on commit 199dbcb

Please sign in to comment.