File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
framework/components/blockchain Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,22 @@ func newAnvilZksync(in *Input) (*Output, error) {
4545 defaultAnvilZksync (in )
4646 req := baseRequest (in )
4747
48- tempDir , err := os .MkdirTemp ("." , "anvil-zksync-dockercontext- " )
48+ tempDir , err := os .MkdirTemp ("." , "anvil-zksync-dockercontext" )
4949 if err != nil {
5050 return nil , err
5151 }
5252
53+ defer func () {
54+ // delete the folder wether it was successful or not
55+ _ = os .RemoveAll (tempDir )
56+ }()
57+
5358 dockerfilePath := filepath .Join (tempDir , "anvilZksync.Dockerfile" )
5459
5560 if err := os .WriteFile (dockerfilePath , []byte (dockerFile ), 0600 ); err != nil {
5661 return nil , err
5762 }
63+
5864 req .FromDockerfile = testcontainers.FromDockerfile {
5965 Context : tempDir ,
6066 Dockerfile : "anvilZksync.Dockerfile" ,
@@ -68,12 +74,9 @@ func newAnvilZksync(in *Input) (*Output, error) {
6874 " --chain-id " + in .ChainID +
6975 " --port " + in .Port }
7076
71- framework .L .Info ().Any ("Cmd" , strings .Join (req .Entrypoint , " " )).Msg ("Creating anvil with command" )
77+ framework .L .Info ().Any ("Cmd" , strings .Join (req .Entrypoint , " " )).Msg ("Creating anvil zkSync with command" )
7278
7379 output , err := createGenericEvmContainer (in , req )
74- // try to delete the file even if there is an error
75- _ = os .RemoveAll (tempDir )
76-
7780 if err != nil {
7881 return nil , err
7982 }
You can’t perform that action at this time.
0 commit comments