@@ -3279,3 +3279,40 @@ Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
3279
3279
3280
3280
"# ] ] ) ;
3281
3281
} ) ;
3282
+
3283
+ // <https://github.com/foundry-rs/foundry/issues/10060>
3284
+ forgetest_init ! ( should_redact_pk_in_sign_delegation, |prj, cmd| {
3285
+ prj. add_test(
3286
+ "Counter.t.sol" ,
3287
+ r#"
3288
+ import "forge-std/Test.sol";
3289
+ contract CounterTest is Test {
3290
+ function testCheckDelegation() external {
3291
+ (address alice, uint256 key) = makeAddrAndKey("alice");
3292
+ vm.signDelegation(address(0), key);
3293
+ vm.signAndAttachDelegation(address(0), key);
3294
+ }
3295
+ }
3296
+ "# ,
3297
+ )
3298
+ . unwrap( ) ;
3299
+
3300
+ cmd. args( [ "test" , "--mt" , "testCheckDelegation" , "-vvvv" ] ) . assert_success( ) . stdout_eq( str ![ [ r#"
3301
+ ...
3302
+ Ran 1 test for test/Counter.t.sol:CounterTest
3303
+ [PASS] testCheckDelegation() ([GAS])
3304
+ Traces:
3305
+ [..] CounterTest::testCheckDelegation()
3306
+ ├─ [0] VM::addr(<pk>) [staticcall]
3307
+ │ └─ ← [Return] alice: [0x328809Bc894f92807417D2dAD6b7C998c1aFdac6]
3308
+ ├─ [0] VM::label(alice: [0x328809Bc894f92807417D2dAD6b7C998c1aFdac6], "alice")
3309
+ │ └─ ← [Return]
3310
+ ├─ [0] VM::signDelegation(0x0000000000000000000000000000000000000000, "<pk>")
3311
+ │ └─ ← [Return] (0, 0x3d6ad67cc3dc94101a049f85f96937513a05485ae0f8b27545d25c4f71b12cf9, 0x3c0f2d62834f59d6ef0209e8a935f80a891a236eb18ac0e3700dd8f7ac8ae279, 0, 0x0000000000000000000000000000000000000000)
3312
+ ├─ [0] VM::signAndAttachDelegation(0x0000000000000000000000000000000000000000, "<pk>")
3313
+ │ └─ ← [Return] (0, 0x3d6ad67cc3dc94101a049f85f96937513a05485ae0f8b27545d25c4f71b12cf9, 0x3c0f2d62834f59d6ef0209e8a935f80a891a236eb18ac0e3700dd8f7ac8ae279, 0, 0x0000000000000000000000000000000000000000)
3314
+ └─ ← [Stop]
3315
+ ...
3316
+
3317
+ "# ] ] ) ;
3318
+ } ) ;
0 commit comments