예제 #1
0
        public static NEP6Wallet Migrate(string path, string db3path, string password)
        {
            UserWallet wallet_old = UserWallet.Open(db3path, password);
            NEP6Wallet wallet_new = new NEP6Wallet(path, wallet_old.Name);

            using (wallet_new.Unlock(password))
            {
                foreach (WalletAccount account in wallet_old.GetAccounts())
                {
                    wallet_new.CreateAccount(account.Contract, account.GetKey());
                }
            }
            return(wallet_new);
        }
예제 #2
0
파일: NEP6Wallet.cs 프로젝트: txhsl/neo
 public static NEP6Wallet Migrate(WalletIndexer indexer, string path, string db3path, string password, uint second)
 {
     using (UserWallet wallet_old = UserWallet.Open(indexer, db3path))
     {
         wallet_old.Unlock(password, second);
         NEP6Wallet wallet_new = new NEP6Wallet(indexer, path, wallet_old.Name);
         wallet_new.Unlock(password, second);
         foreach (WalletAccount account in wallet_old.GetAccounts())
         {
             wallet_new.CreateAccount(account.Contract, account.GetKey());
         }
         return(wallet_new);
     }
 }