Skip to content

Commit c6d0d7b

Browse files
committed
refactor(e2e): use not zero value for deposits network parameters in local-network
1 parent c1ea23f commit c6d0d7b

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

packages/e2e/local-network/scripts/make-babbage.sh

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,27 +172,38 @@ mkdir -p "${ROOT}/genesis/shelley"
172172

173173
mv "${ROOT}/byron-gen-command/genesis.json" "${ROOT}/genesis/byron/genesis-wrong.json"
174174
mv "${ROOT}/genesis.alonzo.json" "${ROOT}/genesis/shelley/genesis.alonzo.json"
175-
mv "${ROOT}/genesis.json" "${ROOT}/genesis/shelley/genesis.json"
175+
mv "${ROOT}/genesis.json" "${ROOT}/genesis/shelley/copy-genesis.json"
176176

177177
jq --raw-output ".protocolConsts.protocolMagic = ${NETWORK_MAGIC}" "${ROOT}/genesis/byron/genesis-wrong.json" >"${ROOT}/genesis/byron/genesis.json"
178178

179179
rm "${ROOT}/genesis/byron/genesis-wrong.json"
180180

181-
sed_i \
182-
-e 's/"slotLength": 1/"slotLength": 0.2/' \
183-
-e 's/"activeSlotsCoeff": 5.0e-2/"activeSlotsCoeff": 0.1/' \
184-
-e 's/"securityParam": 2160/"securityParam": 10/' \
185-
-e 's/"epochLength": 432000/"epochLength": 1000/' \
186-
-e "s/\"maxLovelaceSupply\": 0/\"maxLovelaceSupply\": ${MAX_SUPPLY}/" \
187-
-e 's/"minFeeA": 1/"minFeeA": 44/' \
188-
-e 's/"minFeeB": 0/"minFeeB": 155381/' \
189-
-e 's/"minUTxOValue": 0/"minUTxOValue": 1000000/' \
190-
-e 's/"decentralisationParam": 1.0/"decentralisationParam": 0.7/' \
191-
-e 's/"major": 0/"major": 7/' \
192-
-e 's/"rho": 0.0/"rho": 0.1/' \
193-
-e 's/"tau": 0.0/"tau": 0.1/' \
194-
-e 's/"updateQuorum": 5/"updateQuorum": 2/' \
195-
"${ROOT}/genesis/shelley/genesis.json"
181+
jq -M '
182+
. + {
183+
activeSlotsCoeff: 0.1,
184+
epochLength: 1000,
185+
securityParam: 10,
186+
slotLength: 0.2,
187+
updateQuorum: 2
188+
} |
189+
.protocolParams += {
190+
decentralisationParam: 0.7,
191+
keyDeposit: 2000000,
192+
minFeeA: 44,
193+
minFeeB: 155381,
194+
minUTxOValue: 1000000,
195+
poolDeposit: 500000000,
196+
protocolVersion: { major : 7, minor: 0 },
197+
rho: 0.1,
198+
tau: 0.1
199+
}' "${ROOT}/genesis/shelley/copy-genesis.json" > "${ROOT}/genesis/shelley/genesis.json"
200+
201+
rm "${ROOT}/genesis/shelley/copy-genesis.json"
202+
203+
# Previous version was trying to set this to ${MAX_SUPPLY}, but it wasn't able to due to a wrong regular expression.
204+
# Setting it to ${MAX_SUPPLY} somehow breaks the local-network with some negative stake amount (issue not investigated).
205+
# jq changes this value in 9E+16 which is the same value, but the exponential representation somehow breaks the local-network (issue not investigated).
206+
sed_i -e "s/\"maxLovelaceSupply\": [^,]*/\"maxLovelaceSupply\": 90000000000000000/" "${ROOT}/genesis/shelley/genesis.json"
196207

197208
for NODE_ID in ${SP_NODES_ID}; do
198209
TARGET="${ROOT}/node-sp${NODE_ID}"

packages/e2e/local-network/scripts/pools/update-node-utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ updatePool() {
128128
--byron-witness-count 0 \
129129
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
130130

131+
keyDeposit=2000000
131132
initialBalance=$(getAddressBalance "$genesisAddr")
132-
txOut=$((initialBalance - fee))
133+
txOut=$((initialBalance - fee - keyDeposit))
133134

134135
cardano-cli transaction build-raw \
135136
--tx-in "$utxo" \

0 commit comments

Comments
 (0)