Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
116b6e62
Unverified
Commit
116b6e62
authored
Aug 19, 2024
by
Sam Stokes
Committed by
GitHub
Aug 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
txmgr: rename Get|SetPriorityFee to Get|SetMinPriorityFee (#11526)
parent
ddeb96b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
23 deletions
+33
-23
rpc.go
op-service/txmgr/rpc.go
+4
-4
rpc_test.go
op-service/txmgr/rpc_test.go
+26
-16
txmgr.go
op-service/txmgr/txmgr.go
+3
-3
No files found.
op-service/txmgr/rpc.go
View file @
116b6e62
...
...
@@ -21,12 +21,12 @@ func (a *SimpleTxmgrAPI) SetMinBaseFee(_ context.Context, val *big.Int) {
a
.
mgr
.
SetMinBaseFee
(
val
)
}
func
(
a
*
SimpleTxmgrAPI
)
GetPriorityFee
(
_
context
.
Context
)
*
big
.
Int
{
return
a
.
mgr
.
GetPriorityFee
()
func
(
a
*
SimpleTxmgrAPI
)
Get
Min
PriorityFee
(
_
context
.
Context
)
*
big
.
Int
{
return
a
.
mgr
.
Get
Min
PriorityFee
()
}
func
(
a
*
SimpleTxmgrAPI
)
SetPriorityFee
(
_
context
.
Context
,
val
*
big
.
Int
)
{
a
.
mgr
.
SetPriorityFee
(
val
)
func
(
a
*
SimpleTxmgrAPI
)
Set
Min
PriorityFee
(
_
context
.
Context
,
val
*
big
.
Int
)
{
a
.
mgr
.
Set
Min
PriorityFee
(
val
)
}
func
(
a
*
SimpleTxmgrAPI
)
GetMinBlobFee
(
_
context
.
Context
)
*
big
.
Int
{
...
...
op-service/txmgr/rpc_test.go
View file @
116b6e62
...
...
@@ -11,16 +11,18 @@ import (
)
func
TestTxmgrRPC
(
t
*
testing
.
T
)
{
minBaseFee
:=
big
.
NewInt
(
1000
)
priorityFee
:=
big
.
NewInt
(
2000
)
minBlobFee
:=
big
.
NewInt
(
3000
)
feeThreshold
:=
big
.
NewInt
(
4000
)
minBaseFeeInit
:=
big
.
NewInt
(
1000
)
minPriorityFeeInit
:=
big
.
NewInt
(
2000
)
minBlobFeeInit
:=
big
.
NewInt
(
3000
)
feeThresholdInit
:=
big
.
NewInt
(
4000
)
bumpFeeRetryTimeInit
:=
int64
(
100
)
cfg
:=
Config
{}
cfg
.
MinBaseFee
.
Store
(
minBaseFee
)
cfg
.
MinTipCap
.
Store
(
priorityFee
)
cfg
.
MinBlobTxFee
.
Store
(
minBlobFee
)
cfg
.
FeeLimitThreshold
.
Store
(
feeThreshold
)
cfg
.
MinBaseFee
.
Store
(
minBaseFeeInit
)
cfg
.
MinTipCap
.
Store
(
minPriorityFeeInit
)
cfg
.
MinBlobTxFee
.
Store
(
minBlobFeeInit
)
cfg
.
FeeLimitThreshold
.
Store
(
feeThresholdInit
)
cfg
.
ResubmissionTimeout
.
Store
(
bumpFeeRetryTimeInit
)
h
:=
newTestHarnessWithConfig
(
t
,
&
cfg
)
...
...
@@ -43,22 +45,30 @@ func TestTxmgrRPC(t *testing.T) {
type
tcase
struct
{
rpcMethod
string
value
*
big
.
Int
initValue
*
big
.
Int
}
cases
:=
[]
tcase
{
{
"MinBaseFee"
,
big
.
NewInt
(
1001
)},
{
"PriorityFee"
,
big
.
NewInt
(
2001
)},
{
"MinBlobFee"
,
big
.
NewInt
(
3001
)},
{
"FeeThreshold"
,
big
.
NewInt
(
4001
)},
{
"MinBaseFee"
,
minBaseFeeInit
},
{
"MinPriorityFee"
,
minPriorityFeeInit
},
{
"MinBlobFee"
,
minBlobFeeInit
},
{
"FeeThreshold"
,
feeThresholdInit
},
{
"BumpFeeRetryTime"
,
big
.
NewInt
(
bumpFeeRetryTimeInit
)},
}
for
_
,
tc
:=
range
cases
{
t
.
Run
(
tc
.
rpcMethod
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Get|Set"
+
tc
.
rpcMethod
,
func
(
t
*
testing
.
T
)
{
var
res
*
big
.
Int
require
.
NoError
(
t
,
rpcClient
.
Call
(
&
res
,
"txmgr_set"
+
tc
.
rpcMethod
,
tc
.
value
))
require
.
NoError
(
t
,
rpcClient
.
Call
(
&
res
,
"txmgr_get"
+
tc
.
rpcMethod
))
require
.
Equal
(
t
,
tc
.
initValue
,
res
)
newVal
:=
new
(
big
.
Int
)
newVal
.
Add
(
tc
.
initValue
,
big
.
NewInt
(
1
))
require
.
NoError
(
t
,
rpcClient
.
Call
(
&
res
,
"txmgr_set"
+
tc
.
rpcMethod
,
newVal
))
require
.
NoError
(
t
,
rpcClient
.
Call
(
&
res
,
"txmgr_get"
+
tc
.
rpcMethod
))
require
.
Equal
(
t
,
tc
.
value
,
res
)
require
.
Equal
(
t
,
newVal
,
res
)
})
}
}
op-service/txmgr/txmgr.go
View file @
116b6e62
...
...
@@ -340,13 +340,13 @@ func (m *SimpleTxManager) SetMinBaseFee(val *big.Int) {
m
.
l
.
Info
(
"txmgr config val changed: SetMinBaseFee"
,
"newVal"
,
val
)
}
func
(
m
*
SimpleTxManager
)
GetPriorityFee
()
*
big
.
Int
{
func
(
m
*
SimpleTxManager
)
Get
Min
PriorityFee
()
*
big
.
Int
{
return
m
.
cfg
.
MinTipCap
.
Load
()
}
func
(
m
*
SimpleTxManager
)
SetPriorityFee
(
val
*
big
.
Int
)
{
func
(
m
*
SimpleTxManager
)
Set
Min
PriorityFee
(
val
*
big
.
Int
)
{
m
.
cfg
.
MinTipCap
.
Store
(
val
)
m
.
l
.
Info
(
"txmgr config val changed: SetPriorityFee"
,
"newVal"
,
val
)
m
.
l
.
Info
(
"txmgr config val changed: Set
Min
PriorityFee"
,
"newVal"
,
val
)
}
func
(
m
*
SimpleTxManager
)
GetMinBlobFee
()
*
big
.
Int
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment