Skip to content

Commit 782acba

Browse files
committed
fix: stake delegation not working on '8.8.0' in e2e test
A new '--key-reg-deposit-amt' parameter is required with version '8.8.0' when creating the stake address registration certificate.
1 parent befcdea commit 782acba

File tree

2 files changed

+46
-14
lines changed

2 files changed

+46
-14
lines changed

mithril-test-lab/mithril-devnet/mkfiles/mkfiles-cardano.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,6 @@ for ADDR in ${USER_ADDRS}; do
194194
--stake-verification-key-file addresses/${ADDR}-stake.vkey \
195195
--testnet-magic ${NETWORK_MAGIC} \
196196
--out-file addresses/${ADDR}-stake.addr
197-
198-
# Stake addresses registration certs
199-
./cardano-cli stake-address registration-certificate \
200-
--stake-verification-key-file addresses/${ADDR}-stake.vkey \
201-
--out-file addresses/${ADDR}-stake.reg.cert
197+
202198
done
203199

204-
# User N will delegate to pool N
205-
for N in ${POOL_NODES_N}; do
206-
# Stake address delegation certs
207-
./cardano-cli stake-address delegation-certificate \
208-
--stake-verification-key-file addresses/user${N}-stake.vkey \
209-
--cold-verification-key-file node-pool${N}/shelley/cold.vkey \
210-
--out-file addresses/user${N}-stake.deleg.cert
211-
done

mithril-test-lab/mithril-devnet/mkfiles/mkfiles-mithril-delegation.sh

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,53 @@ CURRENT_EPOCH=\$(CARDANO_NODE_SOCKET_PATH=node-pool${N}/ipc/node.sock ./cardano-
2020
--cardano-mode \\
2121
--testnet-magic ${NETWORK_MAGIC} | jq .epoch)
2222
echo ">>>> Current Epoch: \${CURRENT_EPOCH}"
23-
23+
24+
# Stake addresses registration certs
25+
for ADDR in ${USER_ADDRS}; do
26+
if [ "\${CURRENT_CARDANO_ERA}" == "conway" ]; then
27+
KEY_REGISTRATION_DEPOSIT_ANOUNT=\$(CARDANO_NODE_SOCKET_PATH=node-pool${N}/ipc/node.sock ./cardano-cli \${CURRENT_CARDANO_ERA} query gov-state --testnet-magic ${NETWORK_MAGIC} | jq -r .enactState.curPParams.keyDeposit)
28+
if [ "\${KEY_REGISTRATION_DEPOSIT_ANOUNT}" != "null" ]; then
29+
# Conway specific creation of registration certificate
30+
./cardano-cli \${CURRENT_CARDANO_ERA} stake-address registration-certificate \
31+
--stake-verification-key-file addresses/\${ADDR}-stake.vkey \
32+
--out-file addresses/\${ADDR}-stake.reg.cert \
33+
--key-reg-deposit-amt \$KEY_REGISTRATION_DEPOSIT_ANOUNT
34+
else
35+
# Legacy creation of registration certificate
36+
./cardano-cli stake-address registration-certificate \
37+
--stake-verification-key-file addresses/\${ADDR}-stake.vkey \
38+
--out-file addresses/\${ADDR}-stake.reg.cert
39+
fi
40+
else
41+
# Legacy creation of registration certificate
42+
./cardano-cli stake-address registration-certificate \
43+
--stake-verification-key-file addresses/\${ADDR}-stake.vkey \
44+
--out-file addresses/\${ADDR}-stake.reg.cert
45+
fi
46+
done
47+
2448
EOF
2549

50+
# User N will delegate to pool N
51+
for N in ${POOL_NODES_N}; do
52+
cat >> delegate.sh <<EOF
53+
if [ "\${CURRENT_CARDANO_ERA}" == "conway" ]; then
54+
# Stake address delegation certs
55+
./cardano-cli \${CURRENT_CARDANO_ERA} stake-address stake-delegation-certificate \
56+
--stake-verification-key-file addresses/user${N}-stake.vkey \
57+
--cold-verification-key-file node-pool${N}/shelley/cold.vkey \
58+
--out-file addresses/user${N}-stake.deleg.cert
59+
else
60+
# Stake address delegation certs
61+
./cardano-cli \${CURRENT_CARDANO_ERA} stake-address delegation-certificate \
62+
--stake-verification-key-file addresses/user${N}-stake.vkey \
63+
--cold-verification-key-file node-pool${N}/shelley/cold.vkey \
64+
--out-file addresses/user${N}-stake.deleg.cert
65+
fi
66+
67+
EOF
68+
done
69+
2670
# Prepare transactions for delegating to stake pools
2771
for N in ${POOL_NODES_N}; do
2872
cat >> delegate.sh <<EOF

0 commit comments

Comments
 (0)