From f9b046704800883d2986be05e91367cd0ecaad2b Mon Sep 17 00:00:00 2001 From: Jonathan Chappelow Date: Mon, 6 Feb 2023 09:43:24 -0600 Subject: [PATCH] client/asset/eth: fix unable to write compliant_providers.json --- client/asset/eth/eth.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/asset/eth/eth.go b/client/asset/eth/eth.go index 776d09f319..4770a79dcb 100644 --- a/client/asset/eth/eth.go +++ b/client/asset/eth/eth.go @@ -15,6 +15,7 @@ import ( "fmt" "math" "math/big" + "os" "os/user" "path/filepath" "sort" @@ -589,6 +590,11 @@ func createWallet(createWalletParams *asset.CreateWalletParams, skipConnect bool // defer node.Close() // return importKeyToNode(node, privateKey, createWalletParams.Pass) case walletTypeRPC: + // Make the wallet dir if it does not exist, otherwise we may fail to + // write the compliant_providers.json file. + if err := os.MkdirAll(walletDir, 0700); err != nil { + return err + } // Check that we can connect to all endpoints. providerDef := createWalletParams.Settings[providersKey]