mirror of
https://github.com/status-im/status-go.git
synced 2026-08-31 09:01:16 +00:00
`common` was a grab-bag with no domain: the issue's own preamble names it as the kind of package that must not exist. Every symbol moves to the package that owns it, and the directory is deleted. common/dbsetup -> internal/db/dbsetup common/devices.go -> internal/platform common/pausable*.go -> internal/pausable LogOnPanic -> internal/panics TruncateWithDot(N) -> internal/logutils RecoverKey, ValidateDisplayName, display-name errors -> protocol/common IpfsGatewayURL -> internal/ipfs.GatewayURL Archives/TorrentTorrentsRelativePath, MainnetEthereumNetworkURL -> params StatusService -> pkg/backend/node ErrBigIntSetFromString -> services/wallet IsNil, Ptr -> inlined at their call sites IsENSName -> deleted, it had no callers Notes: - LogOnPanic gets its own package rather than living in logutils. It reports to Sentry, and logutils is imported by nearly everything: put the guard in logutils and the Sentry SDK lands in every dependency graph in the tree (213 -> 250 packages). internal/panics imports logutils and sentry, which is the direction root `common` had. - TruncateWithDot is log redaction, not string formatting: every one of its 121 call sites is inside a log or error message, so it belongs next to the logger. - Moving RecoverKey and ValidateDisplayName into protocol/common removes the common -> protocol layering inversion; all their callers were already inside protocol/. - Makefile lint-panics target follows LogOnPanic to its new path. refs #7067
24 lines
523 B
Go
24 lines
523 B
Go
package node
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/status-im/status-go/internal/pausable"
|
|
)
|
|
|
|
func TestPauseResumeBackgroundLifecycleHooks(t *testing.T) {
|
|
p := newFakePausable("wallet")
|
|
reg := newServiceRegistry()
|
|
reg.Register(p)
|
|
node := &StatusNode{
|
|
serviceRegistry: reg,
|
|
}
|
|
|
|
require.NoError(t, node.Pause())
|
|
require.Equal(t, pausable.ServiceStatePaused, p.PausableState())
|
|
require.NoError(t, node.Resume())
|
|
require.Equal(t, pausable.ServiceStateRunning, p.PausableState())
|
|
}
|