Patch for concurrent iterator & others (onto v1.11.6) #386
@ -142,7 +142,9 @@ func Main(ctx *cli.Context) error {
|
|||||||
// Figure out the prestate alloc
|
// Figure out the prestate alloc
|
||||||
if allocStr == stdinSelector || envStr == stdinSelector || txStr == stdinSelector {
|
if allocStr == stdinSelector || envStr == stdinSelector || txStr == stdinSelector {
|
||||||
decoder := json.NewDecoder(os.Stdin)
|
decoder := json.NewDecoder(os.Stdin)
|
||||||
decoder.Decode(inputData)
|
if err := decoder.Decode(inputData); err != nil {
|
||||||
|
return NewError(ErrorJson, fmt.Errorf("failed unmarshaling stdin: %v", err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if allocStr != stdinSelector {
|
if allocStr != stdinSelector {
|
||||||
inFile, err := os.Open(allocStr)
|
inFile, err := os.Open(allocStr)
|
||||||
@ -152,7 +154,7 @@ func Main(ctx *cli.Context) error {
|
|||||||
defer inFile.Close()
|
defer inFile.Close()
|
||||||
decoder := json.NewDecoder(inFile)
|
decoder := json.NewDecoder(inFile)
|
||||||
if err := decoder.Decode(&inputData.Alloc); err != nil {
|
if err := decoder.Decode(&inputData.Alloc); err != nil {
|
||||||
return NewError(ErrorJson, fmt.Errorf("Failed unmarshaling alloc-file: %v", err))
|
return NewError(ErrorJson, fmt.Errorf("failed unmarshaling alloc-file: %v", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prestate.Pre = inputData.Alloc
|
prestate.Pre = inputData.Alloc
|
||||||
@ -167,7 +169,7 @@ func Main(ctx *cli.Context) error {
|
|||||||
decoder := json.NewDecoder(inFile)
|
decoder := json.NewDecoder(inFile)
|
||||||
var env stEnv
|
var env stEnv
|
||||||
if err := decoder.Decode(&env); err != nil {
|
if err := decoder.Decode(&env); err != nil {
|
||||||
return NewError(ErrorJson, fmt.Errorf("Failed unmarshaling env-file: %v", err))
|
return NewError(ErrorJson, fmt.Errorf("failed unmarshaling env-file: %v", err))
|
||||||
}
|
}
|
||||||
inputData.Env = &env
|
inputData.Env = &env
|
||||||
}
|
}
|
||||||
@ -180,7 +182,7 @@ func Main(ctx *cli.Context) error {
|
|||||||
// Construct the chainconfig
|
// Construct the chainconfig
|
||||||
var chainConfig *params.ChainConfig
|
var chainConfig *params.ChainConfig
|
||||||
if cConf, extraEips, err := tests.GetChainConfig(ctx.String(ForknameFlag.Name)); err != nil {
|
if cConf, extraEips, err := tests.GetChainConfig(ctx.String(ForknameFlag.Name)); err != nil {
|
||||||
return NewError(ErrorVMConfig, fmt.Errorf("Failed constructing chain configuration: %v", err))
|
return NewError(ErrorVMConfig, fmt.Errorf("failed constructing chain configuration: %v", err))
|
||||||
} else {
|
} else {
|
||||||
chainConfig = cConf
|
chainConfig = cConf
|
||||||
vmConfig.ExtraEips = extraEips
|
vmConfig.ExtraEips = extraEips
|
||||||
@ -197,7 +199,7 @@ func Main(ctx *cli.Context) error {
|
|||||||
defer inFile.Close()
|
defer inFile.Close()
|
||||||
decoder := json.NewDecoder(inFile)
|
decoder := json.NewDecoder(inFile)
|
||||||
if err := decoder.Decode(&txsWithKeys); err != nil {
|
if err := decoder.Decode(&txsWithKeys); err != nil {
|
||||||
return NewError(ErrorJson, fmt.Errorf("Failed unmarshaling txs-file: %v", err))
|
return NewError(ErrorJson, fmt.Errorf("failed unmarshaling txs-file: %v", err))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
txsWithKeys = inputData.Txs
|
txsWithKeys = inputData.Txs
|
||||||
@ -206,7 +208,7 @@ func Main(ctx *cli.Context) error {
|
|||||||
signer := types.MakeSigner(chainConfig, big.NewInt(int64(prestate.Env.Number)))
|
signer := types.MakeSigner(chainConfig, big.NewInt(int64(prestate.Env.Number)))
|
||||||
|
|
||||||
if txs, err = signUnsignedTransactions(txsWithKeys, signer); err != nil {
|
if txs, err = signUnsignedTransactions(txsWithKeys, signer); err != nil {
|
||||||
return NewError(ErrorJson, fmt.Errorf("Failed signing transactions: %v", err))
|
return NewError(ErrorJson, fmt.Errorf("failed signing transactions: %v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over all the tests, run them and aggregate the results
|
// Iterate over all the tests, run them and aggregate the results
|
||||||
@ -277,7 +279,7 @@ func signUnsignedTransactions(txs []*txWithKey, signer types.Signer) (types.Tran
|
|||||||
// This transaction needs to be signed
|
// This transaction needs to be signed
|
||||||
signed, err := types.SignTx(tx, signer, key)
|
signed, err := types.SignTx(tx, signer, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, NewError(ErrorJson, fmt.Errorf("Tx %d: failed to sign tx: %v", i, err))
|
return nil, NewError(ErrorJson, fmt.Errorf("tx %d: failed to sign tx: %v", i, err))
|
||||||
}
|
}
|
||||||
signedTxs = append(signedTxs, signed)
|
signedTxs = append(signedTxs, signed)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user