File tree 4 files changed +169
-23
lines changed
4 files changed +169
-23
lines changed Original file line number Diff line number Diff line change 22
22
// PriorityFeeEstimationTrigger specifies which base fee to trigger priority fee estimation at
23
23
PriorityFeeEstimationTrigger = big .NewInt (100000000000 ) // WEI
24
24
// DefaultPriorityFee is returned if above trigger is not met
25
- DefaultPriorityFee = big .NewInt (3000000000 )
25
+ DefaultPriorityFee = big .NewInt (3000000000 )
26
26
// PriorityFeeIncreaseBoundary signifies a big bump in fee history priority reward, due to which we choose
27
27
// not to consider values under it while calculating the median priority fee.
28
28
PriorityFeeIncreaseBoundary = big .NewInt (200 )
@@ -55,10 +55,10 @@ type GasEstimator struct {
55
55
// price for an ethereum transaction to be included in a block
56
56
// with minimal delay.
57
57
func NewGasEstimator (client * Client , opts GasOptions ) * GasEstimator {
58
- return & GasEstimator {
59
- client : client ,
60
- options : & opts ,
61
- }
58
+ return & GasEstimator {
59
+ client : client ,
60
+ options : & opts ,
61
+ }
62
62
}
63
63
64
64
// NewDefaultGasEstimator returns a simple gas estimator with default gas options
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ import (
8
8
"math"
9
9
"math/big"
10
10
11
+ blake2 "github.com/dchest/blake2b"
12
+
11
13
"github.com/btcsuite/btcd/btcec"
12
14
"github.com/btcsuite/btcd/chaincfg/chainhash"
13
15
"github.com/btcsuite/btcd/txscript"
14
16
"github.com/btcsuite/btcd/wire"
15
- "github.com/codahale/blake2"
16
17
"github.com/renproject/multichain/api/utxo"
17
18
"github.com/renproject/multichain/chain/bitcoin"
18
19
"github.com/renproject/pack"
@@ -483,16 +484,15 @@ func calculateSighash(
483
484
}
484
485
485
486
func blake2b (data , key []byte ) (h chainhash.Hash , err error ) {
486
- bHash := blake2 .New (& blake2.Config {
487
- Size : 32 ,
488
- Personal : key ,
489
- })
490
-
491
- if _ , err = bHash .Write (data ); err != nil {
487
+ hash , err := blake2 .New (& blake2.Config {Person : key , Size : 32 })
488
+ if err != nil {
489
+ return h , err
490
+ }
491
+ if _ , err = hash .Write (data ); err != nil {
492
492
return h , err
493
493
}
494
494
495
- err = (& h ).SetBytes (bHash .Sum (nil ))
495
+ err = (& h ).SetBytes (hash .Sum (nil ))
496
496
return h , err
497
497
}
498
498
Original file line number Diff line number Diff line change 5
5
require (
6
6
github.com/btcsuite/btcd v0.21.0-beta
7
7
github.com/btcsuite/btcutil v1.0.2
8
- github.com/codahale/blake2 v0.0.0-20150924215134-8d10d0420cbf
9
8
github.com/cosmos/cosmos-sdk v0.39.1
9
+ github.com/dchest/blake2b v1.0.0
10
10
github.com/ethereum/go-ethereum v1.10.6
11
11
github.com/filecoin-project/go-address v0.0.5
12
12
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec
You can’t perform that action at this time.
0 commit comments