@@ -139,6 +139,7 @@ setup_test_permissions() {
139139 local TEST_ACCOUNT=" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
140140 local ADMIN_ACCOUNT=" 0x0534aA41907c9631fae990960bCC72d75fA7cfeD"
141141 local SUBMITTER_ROLE=" 0x22ebb4dbafb72948800c1e1afa1688772a1a4cfc54d5ebfcec8163b1139c082e"
142+ local EXIT_REQUEST_LIMIT_MANAGER_ROLE=" 0x9c616dd118785b2e2fccf45a4ff151a335ff7b6a84cd1c4d7fd9f97f39ea9342"
142143
143144 print_status " Impersonating Aragon Agent and granting role..."
144145
@@ -147,19 +148,32 @@ setup_test_permissions() {
147148 -d " {\" jsonrpc\" :\" 2.0\" ,\" method\" :\" anvil_impersonateAccount\" ,\" params\" :[\" $ADMIN_ACCOUNT \" ],\" id\" :1}" \
148149 http://localhost:$ANVIL_PORT > /dev/null
149150
150- # Give it ETH
151+ # Give ETH to admin account (100 ETH)
151152 curl -s -X POST -H " Content-Type: application/json" \
152- -d " {\" jsonrpc\" :\" 2.0\" ,\" method\" :\" anvil_setBalance\" ,\" params\" :[\" $ADMIN_ACCOUNT \" ,\" 0x21E19E0C9BAB2400000 \" ],\" id\" :1}" \
153+ -d " {\" jsonrpc\" :\" 2.0\" ,\" method\" :\" anvil_setBalance\" ,\" params\" :[\" $ADMIN_ACCOUNT \" ,\" 0x56BC75E2D630E0000 \" ],\" id\" :1}" \
153154 http://localhost:$ANVIL_PORT > /dev/null
154155
155- # Grant role using cast
156+ # Give ETH to test account (1000 ETH to ensure enough for all tests)
157+ curl -s -X POST -H " Content-Type: application/json" \
158+ -d " {\" jsonrpc\" :\" 2.0\" ,\" method\" :\" anvil_setBalance\" ,\" params\" :[\" $TEST_ACCOUNT \" ,\" 0x3635C9ADC5DEA00000\" ],\" id\" :1}" \
159+ http://localhost:$ANVIL_PORT > /dev/null
160+
161+ # Grant submitter role using cast
156162 print_status " Granting submitter role to test account..."
157163 ETH_FROM=$ADMIN_ACCOUNT cast send $VEBO_CONTRACT " grantRole(bytes32,address)" \
158164 $SUBMITTER_ROLE $TEST_ACCOUNT \
159165 --rpc-url http://localhost:$ANVIL_PORT \
160166 --unlocked \
161167 --gas-limit 200000 > /dev/null 2>&1
162168
169+ # Grant limit manager role using cast
170+ print_status " Granting exit request limit manager role to test account..."
171+ ETH_FROM=$ADMIN_ACCOUNT cast send $VEBO_CONTRACT " grantRole(bytes32,address)" \
172+ $EXIT_REQUEST_LIMIT_MANAGER_ROLE $TEST_ACCOUNT \
173+ --rpc-url http://localhost:$ANVIL_PORT \
174+ --unlocked \
175+ --gas-limit 200000 > /dev/null 2>&1
176+
163177 print_success " Test permissions setup completed"
164178 sleep 1
165179}
@@ -195,7 +209,7 @@ run_test_command() {
195209 local has_errors=false
196210 if [ $exit_code -ne 0 ]; then
197211 has_errors=true
198- elif grep -q " RPC request failed\|execution reverted\|Transaction failed\|Failed to submit\|Error:" " $temp_output " ; then
212+ elif grep -q " RPC request failed\|execution reverted\|Transaction failed\|Failed to submit\|Error:\|Insufficient funds\|insufficient funds " " $temp_output " ; then
199213 has_errors=true
200214 fi
201215
@@ -238,6 +252,19 @@ run_tests() {
238252 run_test_command " Trigger exit with submitted data" \
239253 " ../run.sh vebo trigger-exit --calldata 0x000001000000000f00000000000030391234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef --format 1 --value 0.001"
240254
255+ # Test 4: Test set-limits command with valid parameters
256+ print_status " Testing set-limits with valid parameters..."
257+ print_status " Note: This test sets new exit request limits on the VEB contract"
258+
259+ # Ensure test account has enough ETH for this expensive transaction
260+ print_status " Ensuring sufficient ETH balance for set-limits test..."
261+ curl -s -X POST -H " Content-Type: application/json" \
262+ -d " {\" jsonrpc\" :\" 2.0\" ,\" method\" :\" anvil_setBalance\" ,\" params\" :[\" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\" ,\" 0x3635C9ADC5DEA00000\" ],\" id\" :1}" \
263+ http://localhost:$ANVIL_PORT > /dev/null
264+
265+ run_test_command " Set exit request limits" \
266+ " ../run.sh vebo set-limits --max-exit-requests-limit 11200 --exits-per-frame 1 --frame-duration 48"
267+
241268 print_status " Test suite completed"
242269}
243270
0 commit comments