@@ -16,15 +16,15 @@ import (
1616
1717// TestLayoutAPI that's the example of using helpers to override storage in your contracts
1818func TestLayoutAPI (t * testing.T ) {
19- // t.Skip("this test is for manual debugging and figuring out layout of custom structs")
19+ t .Skip ("this test is for manual debugging and figuring out layout of custom structs" )
2020 // load contract layout file, see testdata/layout.json
2121 // more docs here - https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html#
2222 layout , err := evm_storage .New (layoutFile )
2323 if err != nil {
2424 t .Fatalf ("failed to load layout: %v" , err )
2525 }
2626
27- encodeFunc := func (addr string , index uint8 , group uint8 ) string {
27+ encodeCustomStructFunc := func (addr string , index uint8 , group uint8 ) string {
2828 // huge structs can be packed differently to save space
2929 // cast storage 0x5FbDB2315678afecb367f032d93F642f64180aa3 0x1 --rpc-url http://localhost:8545
3030 addrBytes , _ := hex .DecodeString (strings .TrimPrefix (addr , "0x" ))
@@ -82,7 +82,7 @@ func TestLayoutAPI(t *testing.T) {
8282 }
8383 {
8484 slot := layout .MustArraySlot ("a_signers" , 1 )
85- data := encodeFunc ("0x00000000000000000000000000000000000000a5" , 255 , 42 )
85+ data := encodeCustomStructFunc ("0x00000000000000000000000000000000000000a5" , 255 , 42 )
8686 fmt .Printf ("setting slot: %s with data: %s\n " , slot , data )
8787 r := rpc .New (testRPCURL , nil )
8888 err = r .AnvilSetStorageAt ([]interface {}{contractAddr , slot , data })
@@ -91,7 +91,7 @@ func TestLayoutAPI(t *testing.T) {
9191 }
9292 {
9393 slot := layout .MustMapSlot ("s_signers" , "0x00000000000000000000000000000000000000a5" )
94- data := encodeFunc ("0x00000000000000000000000000000000000000a5" , 254 , 40 )
94+ data := encodeCustomStructFunc ("0x00000000000000000000000000000000000000a5" , 254 , 40 )
9595 fmt .Printf ("setting slot: %s with data: %s\n " , slot , data )
9696 r := rpc .New (testRPCURL , nil )
9797 err = r .AnvilSetStorageAt ([]interface {}{contractAddr , slot , data })
0 commit comments