示例#1
0
文件: UserWallet.cs 项目: txhsl/neo
        public override WalletAccount CreateAccount(SmartContract.Contract contract, KeyPair key = null)
        {
            VerificationContract verification_contract = contract as VerificationContract;

            if (verification_contract == null)
            {
                verification_contract = new VerificationContract
                {
                    Script        = contract.Script,
                    ParameterList = contract.ParameterList
                };
            }
            byte[] decryptedPrivateKey = new byte[96];
            Buffer.BlockCopy(key.PublicKey.EncodePoint(false), 1, decryptedPrivateKey, 0, 64);
            Buffer.BlockCopy(key.PrivateKey, 0, decryptedPrivateKey, 64, 32);
            UserWalletAccount account = new UserWalletAccount(this, verification_contract.ScriptHash)
            {
                Key = key,
                EncryptedPrivateKey = EncryptPrivateKey(decryptedPrivateKey),
                Contract            = verification_contract
            };

            AddAccount(account, false);
            return(account);
        }
示例#2
0
文件: UserWallet.cs 项目: ProDog/Zoro
 public override WalletAccount CreateAccount(SmartContract.Contract contract, KeyPair key = null)
 {
     VerificationContract verification_contract = contract as VerificationContract;
     if (verification_contract == null)
     {
         verification_contract = new VerificationContract
         {
             Script = contract.Script,
             ParameterList = contract.ParameterList
         };
     }
     UserWalletAccount account = new UserWalletAccount(verification_contract.ScriptHash)
     {
         Key = key,
         Contract = verification_contract
     };
     AddAccount(account, false);
     return account;
 }
示例#3
0
 public override WalletAccount CreateAccount(SmartContract.Contract contract, KeyPair key = null)
 {
     throw new NotSupportedException();
 }