@@ -30,6 +30,9 @@ const (
3030 ErrEmptyConfigPath = "toml config path is empty, set SETH_CONFIG_PATH"
3131 ErrContractDeploymentFailed = "contract deployment failed"
3232
33+ // unused by Seth, but used by upstream
34+ ErrNoKeyLoaded = "failed to load private key"
35+
3336 ContractMapFilePattern = "deployed_contracts_%s_%s.toml"
3437 RevertedTransactionsFilePattern = "reverted_transactions_%s_%s.json"
3538)
@@ -148,7 +151,13 @@ func NewClientWithConfig(cfg *Config) (*Client, error) {
148151 tr , err := NewTracer (cs , & abiFinder , cfg , contractAddressToNameMap , addrs )
149152 if err != nil {
150153 return nil , fmt .Errorf ("failed to create transaction tracer: %w\n " +
151- "This is usually caused by RPC connection issues. Verify your RPC endpoint is accessible" ,
154+ "Possible causes:\n " +
155+ " 1. RPC endpoint is not accessible\n " +
156+ " 2. RPC node doesn't support debug_traceTransaction API\n " +
157+ "Solutions:\n " +
158+ " 1. Verify RPC endpoint URL is correct and accessible\n " +
159+ " 2. Use an RPC node with debug API enabled (archive node recommended)\n " +
160+ " 3. Set tracing_level = 'NONE' in config to disable tracing" ,
152161 err )
153162 }
154163 opts = append (opts , WithTracer (tr ))
@@ -181,7 +190,7 @@ func NewClientRaw(
181190 opts ... ClientOpt ,
182191) (* Client , error ) {
183192 if cfg == nil {
184- return nil , fmt .Errorf ("Seth configuration is nil. " +
193+ return nil , fmt .Errorf ("seth configuration is nil. " +
185194 "Provide a valid Config when calling NewClientRaw(). " +
186195 "Consider using NewClient() or NewClientWithConfig() instead" )
187196 }
@@ -393,7 +402,13 @@ func NewClientRaw(
393402 tr , err := NewTracer (c .ContractStore , c .ABIFinder , cfg , c .ContractAddressToNameMap , addrs )
394403 if err != nil {
395404 return nil , fmt .Errorf ("failed to create transaction tracer: %w\n " +
396- "Ensure RPC endpoint supports debug_traceTransaction or set tracing_level = 'NONE'" ,
405+ "Possible causes:\n " +
406+ " 1. RPC endpoint is not accessible\n " +
407+ " 2. RPC node doesn't support debug_traceTransaction API\n " +
408+ "Solutions:\n " +
409+ " 1. Verify RPC endpoint URL is correct and accessible\n " +
410+ " 2. Use an RPC node with debug API enabled (archive node recommended)\n " +
411+ " 3. Set tracing_level = 'NONE' in config to disable tracing" ,
397412 err )
398413 }
399414
@@ -1280,70 +1295,29 @@ func (m *Client) DeployContractFromContractStore(auth *bind.TransactOpts, name s
12801295 "This usually means:\n " +
12811296 " 1. Seth client wasn't properly initialized\n " +
12821297 " 2. ABI directory path is incorrect in config\n " +
1283- "Ensure 'abi_dir' and 'bin_dir' are set in seth.toml or use DeployContract() with explicit ABI/bytecode" )
1298+ "Solutions:\n " +
1299+ " 1. Set 'abi_dir' and 'bin_dir' in seth.toml config file\n " +
1300+ " 2. Use ClientBuilder: builder.WithABIDir(path).WithBINDir(path)\n " +
1301+ " 3. Use DeployContract() method with explicit ABI/bytecode instead" )
12841302 }
12851303
12861304 name = strings .TrimSuffix (name , ".abi" )
12871305 name = strings .TrimSuffix (name , ".bin" )
12881306
12891307 contractAbi , ok := m .ContractStore .ABIs [name + ".abi" ]
12901308 if ! ok {
1291- abiCount := len (m .ContractStore .ABIs )
1292- abiSample := ""
1293- if abiCount > 0 {
1294- // Show first few ABIs as examples (max 5)
1295- sampleSize := 5
1296- if abiCount < sampleSize {
1297- sampleSize = abiCount
1298- }
1299- samples := make ([]string , 0 , sampleSize )
1300- count := 0
1301- for abiName := range m .ContractStore .ABIs {
1302- if count >= sampleSize {
1303- break
1304- }
1305- samples = append (samples , strings .TrimSuffix (abiName , ".abi" ))
1306- count ++
1307- }
1308- abiSample = fmt .Sprintf ("\n Example ABIs available: %s" , strings .Join (samples , ", " ))
1309- if abiCount > sampleSize {
1310- abiSample += fmt .Sprintf (" (and %d more)" , abiCount - sampleSize )
1311- }
1312- }
13131309 return DeploymentData {}, fmt .Errorf ("ABI for contract '%s' not found in contract store.\n " +
1314- "Total ABIs loaded: %d%s \n " +
1310+ "Total ABIs loaded: %d\n " +
13151311 "Ensure the ABI file '%s.abi' exists in the directory specified by 'abi_dir' in your config" ,
1316- name , abiCount , abiSample , name )
1312+ name , len ( m . ContractStore . ABIs ) , name )
13171313 }
13181314
13191315 bytecode , ok := m .ContractStore .BINs [name + ".bin" ]
13201316 if ! ok {
1321- binCount := len (m .ContractStore .BINs )
1322- binSample := ""
1323- if binCount > 0 {
1324- // Show first few BINs as examples (max 5)
1325- sampleSize := 5
1326- if binCount < sampleSize {
1327- sampleSize = binCount
1328- }
1329- samples := make ([]string , 0 , sampleSize )
1330- count := 0
1331- for binName := range m .ContractStore .BINs {
1332- if count >= sampleSize {
1333- break
1334- }
1335- samples = append (samples , strings .TrimSuffix (binName , ".bin" ))
1336- count ++
1337- }
1338- binSample = fmt .Sprintf ("\n Example BINs available: %s" , strings .Join (samples , ", " ))
1339- if binCount > sampleSize {
1340- binSample += fmt .Sprintf (" (and %d more)" , binCount - sampleSize )
1341- }
1342- }
13431317 return DeploymentData {}, fmt .Errorf ("bytecode (BIN) for contract '%s' not found in contract store.\n " +
1344- "Total BINs loaded: %d%s \n " +
1318+ "Total BINs loaded: %d\n " +
13451319 "Ensure the BIN file '%s.bin' exists in the directory specified by 'bin_dir' in your config" ,
1346- name , binCount , binSample , name )
1320+ name , len ( m . ContractStore . BINs ) , name )
13471321 }
13481322
13491323 data , err := m .DeployContract (auth , name , contractAbi , bytecode , params ... )
@@ -1587,7 +1561,7 @@ func (m *Client) validateAddressesKeyNum(keyNum int) error {
15871561 if len (m .Addresses ) == 0 {
15881562 return fmt .Errorf ("no addresses loaded, but tried to use key #%d.\n " +
15891563 "This should not happen if private keys were loaded correctly. " +
1590- "Please report this as a bug " ,
1564+ "Please report this issue at https://github.com/smartcontractkit/chainlink-testing-framework/issues with the stack trace " ,
15911565 keyNum )
15921566 }
15931567 return fmt .Errorf ("keyNum %d is out of range. Available addresses: 0-%d (total: %d addresses loaded).\n " +
0 commit comments