Browse Source

classic it does not work Sends as EIP1559 TX

erro

Shannon: maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet. Check outgoing tx for
master
yuriy0803 3 years ago
parent
commit
9412c61eb8
  1. 1
      api.json
  2. 1
      payouts.json
  3. 8
      payouts/payer.go
  4. 7
      rpc/rpc.go

1
api.json

@ -131,7 +131,6 @@
"address": "0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6", "address": "0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6",
"gas": "21000", "gas": "21000",
"gasPrice": "50000000000", "gasPrice": "50000000000",
"maxPriorityFee": "2000000000",
"autoGas": true, "autoGas": true,
"threshold": 500000000, "threshold": 500000000,
"bgsave": false, "bgsave": false,

1
payouts.json

@ -17,7 +17,6 @@
"address": "0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6", "address": "0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6",
"gas": "21000", "gas": "21000",
"gasPrice": "50000000000", "gasPrice": "50000000000",
"maxPriorityFee": "2000000000",
"autoGas": true, "autoGas": true,
"threshold": 500000000, "threshold": 500000000,
"bgsave": false, "bgsave": false,

8
payouts/payer.go

@ -29,7 +29,6 @@ type PayoutsConfig struct {
Gas string `json:"gas"` Gas string `json:"gas"`
GasPrice string `json:"gasPrice"` GasPrice string `json:"gasPrice"`
AutoGas bool `json:"autoGas"` AutoGas bool `json:"autoGas"`
MaxPriorityFee string `json:"maxPriorityFee"`
// In Shannon // In Shannon
Threshold int64 `json:"threshold"` Threshold int64 `json:"threshold"`
BgSave bool `json:"bgsave"` BgSave bool `json:"bgsave"`
@ -46,11 +45,6 @@ func (self PayoutsConfig) GasPriceHex() string {
return hexutil.EncodeBig(x) return hexutil.EncodeBig(x)
} }
func (self PayoutsConfig) MaxPriorityFeeHex() string {
x := util.String2Big(self.MaxPriorityFee)
return hexutil.EncodeBig(x)
}
type PayoutsProcessor struct { type PayoutsProcessor struct {
config *PayoutsConfig config *PayoutsConfig
backend *storage.RedisClient backend *storage.RedisClient
@ -189,7 +183,7 @@ func (u *PayoutsProcessor) process() {
} }
value := hexutil.EncodeBig(amountInWei) value := hexutil.EncodeBig(amountInWei)
txHash, err := u.rpc.SendTransaction(u.config.Address, login, u.config.GasHex(), u.config.GasPriceHex(), u.config.MaxPriorityFeeHex(), value, u.config.AutoGas) txHash, err := u.rpc.SendTransaction(u.config.Address, login, u.config.GasHex(), u.config.GasPriceHex(), value, u.config.AutoGas)
if err != nil { if err != nil {
log.Printf("Failed to send payment to %s, %v Shannon: %v. Check outgoing tx for %s in block explorer and docs/PAYOUTS.md", log.Printf("Failed to send payment to %s, %v Shannon: %v. Check outgoing tx for %s in block explorer and docs/PAYOUTS.md",
login, amount, err, login) login, amount, err, login)

7
rpc/rpc.go

@ -206,7 +206,7 @@ func (r *RPCClient) GetPeerCount() (int64, error) {
return strconv.ParseInt(strings.Replace(reply, "0x", "", -1), 16, 64) return strconv.ParseInt(strings.Replace(reply, "0x", "", -1), 16, 64)
} }
func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, maxPriorityFee, value string, autoGas bool) (string, error) { func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, value string, autoGas bool) (string, error) {
params := map[string]string{ params := map[string]string{
"from": from, "from": from,
"to": to, "to": to,
@ -216,11 +216,8 @@ func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, maxPriorityFee, val
// Sends as Legacy TX // Sends as Legacy TX
params["gas"] = gas params["gas"] = gas
params["gasPrice"] = gasPrice params["gasPrice"] = gasPrice
} else {
// Sends as EIP1559 TX
params["gas"] = gas
params["maxPriorityFeePerGas"] = maxPriorityFee
} }
rpcResp, err := r.doPost(r.Url, "eth_sendTransaction", []interface{}{params}) rpcResp, err := r.doPost(r.Url, "eth_sendTransaction", []interface{}{params})
var reply string var reply string
if err != nil { if err != nil {

Loading…
Cancel
Save