Upgrade the usage of sender.

This commit is contained in:
maskpp
2023-02-03 11:49:26 +08:00
parent 95d650240f
commit a2ca73d4e4

View File

@@ -39,16 +39,6 @@ var (
ErrNoAvailableAccount = errors.New("sender has no available account to send transaction")
)
// DefaultSenderConfig The default config
var DefaultSenderConfig = config.SenderConfig{
Endpoint: "",
EscalateBlocks: 3,
EscalateMultipleNum: 11,
EscalateMultipleDen: 10,
MaxGasPrice: 1000_000_000_000, // this is 1000 gwei
TxType: AccessListTxType,
}
// Confirmation struct used to indicate transaction confirmation details
type Confirmation struct {
Msg interface{}
@@ -96,7 +86,7 @@ type Sender struct {
// txConfirmationCh is used to notify confirmed transaction
func NewSender(ctx context.Context, config *config.SenderConfig, privs []*ecdsa.PrivateKey) (*Sender, error) {
if config == nil {
config = &DefaultSenderConfig
return nil, errors.New("create sender instance failed due to the empty config")
}
client, err := ethclient.Dial(config.Endpoint)
if err != nil {