Skip to content

Commit f0e9898

Browse files
committed
finalizer -> ethfinalizer
1 parent d1f6f79 commit f0e9898

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ Packages:
138138
- `ethartifacts`: simple pkg to parse Truffle artifact file
139139
- `ethcoder`: encoding/decoding libraries for smart contracts and transactions
140140
- `ethdeploy`: simple method to deploy contract bytecode to a network
141+
- `ethfinalizer`: a wallet adapter for guaranteeing transaction inclusion
141142
- `ethgas`: fetch the latest gas price of a network or track over a period of time
142143
- `ethmonitor`: easily monitor block production, transactions and logs of a chain; with re-org support
143144
- `ethrpc`: http client for Ethereum json-rpc
144145
- `ethwallet`: wallet for Ethereum with support for wallet mnemonics (BIP-39)
145-
- `finalizer`: a wallet adapter for guaranteeing transaction inclusion on a specific chain
146146

147147
## License
148148

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Finalizer
1+
# ethfinalizer
22

33
A wallet adapter for guaranteeing transaction inclusion on a specific chain.
44

@@ -11,7 +11,7 @@ This fixes "nonce too low" issues that can happen if reorgs occur or if you trus
1111
For demonstration:
1212

1313
```go
14-
mempool := finalizer.NewMemoryMempool[struct{}]()
14+
mempool := ethfinalizer.NewMemoryMempool[struct{}]()
1515
```
1616

1717
Here `struct{}` can be any type for transaction metadata, data that gets persisted with the transaction, but not sent on chain.
@@ -23,7 +23,7 @@ For production, implement the `Mempool` interface and persist to a database inst
2323
For EIP-1559 chains:
2424

2525
```go
26-
chain, err := finalizer.NewEthkitChain(finalizer.EthkitChainOptions{
26+
chain, err := ethfinalizer.NewEthkitChain(ethfinalizer.EthkitChainOptions{
2727
ChainID: big.NewInt(1),
2828
IsEIP1559: true,
2929
Provider: provider,
@@ -36,21 +36,21 @@ chain, err := finalizer.NewEthkitChain(finalizer.EthkitChainOptions{
3636
For non-EIP-1559 chains:
3737

3838
```go
39-
chain, err := finalizer.NewEthkitChain(finalizer.EthkitChainOptions{
39+
chain, err := ethfinalizer.NewEthkitChain(ethfinalizer.EthkitChainOptions{
4040
ChainID: big.NewInt(56),
4141
IsEIP1559: false,
4242
Provider: provider,
43-
Monitor: monitor, // must be running
44-
GasGauge: gasGauge, // required for non-EIP-1559 chains
45-
GasGaugeSpeed: finalizer.GasGaugeSpeedDefault // default = fast
46-
PriorityFee: nil, // not used for non-EIP-1559 chains
43+
Monitor: monitor, // must be running
44+
GasGauge: gasGauge, // required for non-EIP-1559 chains
45+
GasGaugeSpeed: ethfinalizer.GasGaugeSpeedDefault // default = fast
46+
PriorityFee: nil, // not used for non-EIP-1559 chains
4747
})
4848
```
4949

5050
### Create a finalizer for a specific wallet on a specific chain
5151

5252
```go
53-
f, err := finalizer.NewFinalizer(finalizer.FinalizerOptions[struct{}]{
53+
f, err := ethfinalizer.NewFinalizer(ethfinalizer.FinalizerOptions[struct{}]{
5454
Wallet: wallet,
5555
Chain: chain,
5656
Mempool: mempool,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package finalizer
1+
package ethfinalizer
22

33
import (
44
"context"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Package finalizer implements a wallet adapter for guaranteeing transaction inclusion on a specific chain.
1+
// Package ethfinalizer implements a wallet adapter for guaranteeing transaction inclusion on a specific chain.
22
//
33
// This fixes "nonce too low" issues that can happen if reorgs occur or if you trust your node's reported nonces.
4-
package finalizer
4+
package ethfinalizer
55

66
import (
77
"context"
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package finalizer_test
1+
package ethfinalizer_test
22

33
import (
44
"context"
@@ -11,8 +11,8 @@ import (
1111
"testing"
1212
"time"
1313

14+
"github.com/0xsequence/ethkit/ethfinalizer"
1415
"github.com/0xsequence/ethkit/ethwallet"
15-
"github.com/0xsequence/ethkit/finalizer"
1616
"github.com/0xsequence/ethkit/go-ethereum/common"
1717
"github.com/0xsequence/ethkit/go-ethereum/core/types"
1818
"github.com/stretchr/testify/assert"
@@ -60,9 +60,9 @@ func test(t *testing.T, isEIP1559 bool) {
6060
})
6161
assert.NoError(t, err)
6262

63-
mempool := finalizer.NewMemoryMempool[struct{}]()
63+
mempool := ethfinalizer.NewMemoryMempool[struct{}]()
6464

65-
finalizer, err := finalizer.NewFinalizer(finalizer.FinalizerOptions[struct{}]{
65+
finalizer, err := ethfinalizer.NewFinalizer(ethfinalizer.FinalizerOptions[struct{}]{
6666
Wallet: wallet,
6767
Chain: chain,
6868
Mempool: mempool,
@@ -228,7 +228,7 @@ type TestChain struct {
228228
highestNonce *uint64
229229
mu sync.RWMutex
230230

231-
subscriptions map[chan finalizer.Diff]struct{}
231+
subscriptions map[chan ethfinalizer.Diff]struct{}
232232
subscriptionsMu sync.RWMutex
233233
}
234234

@@ -246,7 +246,7 @@ func NewTestChain(options TestChainOptions) (*TestChain, error) {
246246

247247
mempool: map[uint64][]*types.Transaction{},
248248

249-
subscriptions: map[chan finalizer.Diff]struct{}{},
249+
subscriptions: map[chan ethfinalizer.Diff]struct{}{},
250250
}, nil
251251
}
252252

@@ -284,7 +284,7 @@ func (c *TestChain) Publish() {
284284
c.subscriptionsMu.RLock()
285285
defer c.subscriptionsMu.RUnlock()
286286

287-
diff := finalizer.Diff{
287+
diff := ethfinalizer.Diff{
288288
Removed: map[common.Hash]struct{}{},
289289
Added: map[common.Hash]struct{}{},
290290
}
@@ -367,11 +367,11 @@ func (c *TestChain) PriorityFee(ctx context.Context) (*big.Int, error) {
367367
return new(big.Int).SetUint64(uniform(c.MinPriorityFee, c.MaxPriorityFee)), nil
368368
}
369369

370-
func (c *TestChain) Subscribe(ctx context.Context) (<-chan finalizer.Diff, error) {
370+
func (c *TestChain) Subscribe(ctx context.Context) (<-chan ethfinalizer.Diff, error) {
371371
c.subscriptionsMu.Lock()
372372
defer c.subscriptionsMu.Unlock()
373373

374-
subscription := make(chan finalizer.Diff)
374+
subscription := make(chan ethfinalizer.Diff)
375375
c.subscriptions[subscription] = struct{}{}
376376

377377
go func() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package finalizer
1+
package ethfinalizer
22

33
import (
44
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package finalizer
1+
package ethfinalizer
22

33
import (
44
"fmt"

0 commit comments

Comments
 (0)