Skip to content

Commit 3ee649c

Browse files
committed
refactor: readability
1 parent f747f0a commit 3ee649c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libevm/extraslock.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ var (
2727
extrasHandle atomic.Uint64
2828
)
2929

30+
// An ExtrasLock is a handle that proves a current call to
31+
// [WithTemporaryExtrasLock].
32+
type ExtrasLock struct {
33+
handle *uint64
34+
}
35+
3036
// WithTemporaryExtrasLock takes a global lock and calls `fn` with a handle that
3137
// can be used to prove that the lock is held. All package-specific temporary
3238
// overrides require this proof.
@@ -48,12 +54,6 @@ func WithTemporaryExtrasLock(fn func(lock ExtrasLock) error) error {
4854
// persisted beyond the call to [WithTemporaryExtrasLock] that created it.
4955
var ErrExpiredExtrasLock = errors.New("libevm.ExtrasLock expired")
5056

51-
// An ExtrasLock is a handle that proves a current call to
52-
// [WithTemporaryExtrasLock].
53-
type ExtrasLock struct {
54-
handle *uint64
55-
}
56-
5757
// Verify verifies that the lock is valid.
5858
func (l ExtrasLock) Verify() error {
5959
if *l.handle != extrasHandle.Load() {

0 commit comments

Comments
 (0)