Skip to content

Commit fb1f707

Browse files
committed
fix warnings
1 parent 4018563 commit fb1f707

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

pkg/coordinator/helper/bigint.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import (
66
)
77

88
type BigInt struct {
9-
big.Int
9+
Value big.Int
1010
}
1111

1212
func (b BigInt) MarshalJSON() ([]byte, error) {
13-
return []byte(b.String()), nil
13+
return []byte(b.Value.String()), nil
1414
}
1515

1616
func (b *BigInt) UnmarshalJSON(p []byte) error {
@@ -22,6 +22,6 @@ func (b *BigInt) UnmarshalJSON(p []byte) error {
2222
if !ok {
2323
return fmt.Errorf("not a valid big integer: %s", p)
2424
}
25-
b.Int = z
25+
b.Value = z
2626
return nil
2727
}

pkg/coordinator/tasks/generate_transaction/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ type Config struct {
4444

4545
func DefaultConfig() Config {
4646
return Config{
47-
FeeCap: &helper.BigInt{*big.NewInt(100000000000)}, // 100 Gwei
48-
TipCap: &helper.BigInt{*big.NewInt(1000000000)}, // 1 Gwei
47+
FeeCap: &helper.BigInt{Value: *big.NewInt(100000000000)}, // 100 Gwei
48+
TipCap: &helper.BigInt{Value: *big.NewInt(1000000000)}, // 1 Gwei
4949
GasLimit: 50000,
50-
Amount: &helper.BigInt{*big.NewInt(0)},
50+
Amount: &helper.BigInt{Value: *big.NewInt(0)},
5151
AwaitReceipt: true,
5252
}
5353
}

pkg/coordinator/tasks/generate_transaction/task.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func (t *Task) generateTransaction(ctx context.Context) (*ethtypes.Transaction,
279279
toAddr = &addr
280280
}
281281

282-
txAmount := new(big.Int).Set(&t.config.Amount.Int)
282+
txAmount := new(big.Int).Set(&t.config.Amount.Value)
283283
if t.config.RandomAmount {
284284
n, err := rand.Int(rand.Reader, txAmount)
285285
if err == nil {
@@ -298,7 +298,7 @@ func (t *Task) generateTransaction(ctx context.Context) (*ethtypes.Transaction,
298298
case t.config.LegacyTxType:
299299
txObj = &ethtypes.LegacyTx{
300300
Nonce: nonce,
301-
GasPrice: &t.config.FeeCap.Int,
301+
GasPrice: &t.config.FeeCap.Value,
302302
Gas: t.config.GasLimit,
303303
To: toAddr,
304304
Value: txAmount,
@@ -321,9 +321,9 @@ func (t *Task) generateTransaction(ctx context.Context) (*ethtypes.Transaction,
321321

322322
txObj = &ethtypes.BlobTx{
323323
Nonce: nonce,
324-
BlobFeeCap: uint256.MustFromBig(&t.config.BlobFeeCap.Int),
325-
GasTipCap: uint256.MustFromBig(&t.config.TipCap.Int),
326-
GasFeeCap: uint256.MustFromBig(&t.config.FeeCap.Int),
324+
BlobFeeCap: uint256.MustFromBig(&t.config.BlobFeeCap.Value),
325+
GasTipCap: uint256.MustFromBig(&t.config.TipCap.Value),
326+
GasFeeCap: uint256.MustFromBig(&t.config.FeeCap.Value),
327327
Gas: t.config.GasLimit,
328328
To: *toAddr,
329329
Value: uint256.MustFromBig(txAmount),
@@ -335,8 +335,8 @@ func (t *Task) generateTransaction(ctx context.Context) (*ethtypes.Transaction,
335335
txObj = &ethtypes.DynamicFeeTx{
336336
ChainID: t.ctx.Scheduler.GetServices().ClientPool().GetExecutionPool().GetBlockCache().GetChainID(),
337337
Nonce: nonce,
338-
GasTipCap: &t.config.TipCap.Int,
339-
GasFeeCap: &t.config.FeeCap.Int,
338+
GasTipCap: &t.config.TipCap.Value,
339+
GasFeeCap: &t.config.FeeCap.Value,
340340
Gas: t.config.GasLimit,
341341
To: toAddr,
342342
Value: txAmount,

0 commit comments

Comments
 (0)