|
|
@ -19,8 +19,8 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
// MemoryAccount is an account type converted from Account.
|
|
|
|
// MemoryAccount is an account type converted from Account.
|
|
|
|
type MemoryAccount struct { |
|
|
|
type MemoryAccount struct { |
|
|
|
Cipher Cipher |
|
|
|
Cipher Cipher |
|
|
|
Key []byte |
|
|
|
Key []byte |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Equals implements protocol.Account.Equals().
|
|
|
|
// Equals implements protocol.Account.Equals().
|
|
|
@ -87,8 +87,8 @@ func (a *Account) AsAccount() (protocol.Account, error) { |
|
|
|
return nil, newError("failed to get cipher").Base(err) |
|
|
|
return nil, newError("failed to get cipher").Base(err) |
|
|
|
} |
|
|
|
} |
|
|
|
return &MemoryAccount{ |
|
|
|
return &MemoryAccount{ |
|
|
|
Cipher: cipher, |
|
|
|
Cipher: cipher, |
|
|
|
Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), |
|
|
|
Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), |
|
|
|
}, nil |
|
|
|
}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|