mirror of
https://github.com/status-im/status-go.git
synced 2026-08-31 00:51:12 +00:00
Part of the Go project layout migration, item 27. Pure move plus import-path rewrite across 502 files. No API or behaviour change. `internal/` keeps the messaging application logic unimportable from outside the module, which is what the issue asks for -- status-go is consumed through the C-bindings in mobile/, not as a Go library. Things that had to follow the move, beyond the Go imports: - tools/generate-handlers/template.txt. messenger_handlers.go is generated, and the template hard-codes the imports it emits, so the generated file kept importing protocol/common and failed typecheck. - .gitignore. The ignore rule for that generated file was pinned to the old path; without moving it, a 1486-line generated file starts being tracked. - Makefile: the logosstorage and torrent test targets (both the archive packages and ./protocol itself), the archive README, migration-protocol. - scripts/run_unit_tests.sh, which names the protocol package explicitly to shard its tests. - scripts/cleanup_generated_files.sh and .golangci.yml. scripts/migration_check.sh also needed a fix that is not specific to this move: it validated every file the branch touched under a migration dir against the timestamp naming rule, and a directory rename makes every migration in it look newly added. It now excludes renames, so moving a migration is not mistaken for adding one. refs #7067
28 lines
1.9 KiB
Go
28 lines
1.9 KiB
Go
package protocol
|
|
|
|
import (
|
|
"github.com/status-im/status-go/internal/accounts-management/generator"
|
|
"github.com/status-im/status-go/internal/accounts-management/types"
|
|
cryptotypes "github.com/status-im/status-go/internal/crypto/types"
|
|
)
|
|
|
|
//go:generate go tool mockgen -package=mock_protocol_accounts_manager -source=accounts_manager_interface.go -destination=mock/messenger_accounts_manager.go
|
|
|
|
// AccountsManager interface for mocking purposes
|
|
type AccountsManager interface {
|
|
GetVerifiedWalletAccount(address cryptotypes.Address, password string) (*generator.Account, error)
|
|
DeleteAccount(address cryptotypes.Address, password string, clock uint64) (account *types.Account, err error)
|
|
DeleteKeypair(keyUID string, password string, clock uint64) (keypair *types.Keypair, err error)
|
|
MakeSeedPhraseKeypairFullyOperable(mnemonic string, password string, clock uint64) (string, error)
|
|
MakePrivateKeyKeypairFullyOperable(privateKey string, password string, clock uint64) (string, error)
|
|
AddAccounts(keyUID string, accounts []*types.Account, password string) error
|
|
CreateKeypairFromMnemonicAndStore(mnemonic string, password string, keypairName string, coldWallet types.ColdWalletType,
|
|
walletAccount *types.AccountCreationDetails, profile bool, clock uint64) (keypair *types.Keypair, err error)
|
|
AddKeypairStoredToColdWallet(keyUID string, masterAddress string, name string, walletXPub string,
|
|
coldWallet types.ColdWalletType, walletAccounts []*types.Account, clock uint64) (keypair *types.Keypair, err error)
|
|
CreateKeypairFromPrivateKeyAndStore(privateKey string, password string, keypairName string,
|
|
walletAccount *types.AccountCreationDetails, clock uint64) (keypair *types.Keypair, err error)
|
|
MigrateKeypairToColdWallet(keyUID string, password string, coldWallet types.ColdWalletType, clock uint64) error
|
|
MigrateColdWalletKeypairToApp(mnemonic string, password string, clock uint64) (string, error)
|
|
}
|