change wallet version when storing
This commit is contained in:
parent
d511103081
commit
ad02e46f56
3 changed files with 66 additions and 2 deletions
|
|
@ -239,6 +239,7 @@ Identity.prototype.retrieveWalletFromStorage = function(walletId, opts, cb) {
|
|||
Identity.prototype.storeWallet = function(wallet, cb) {
|
||||
preconditions.checkArgument(wallet && _.isObject(wallet));
|
||||
|
||||
wallet.setVersion(this.version);
|
||||
var val = wallet.toObj();
|
||||
var key = wallet.getStorageKey();
|
||||
log.debug('Storing wallet:' + wallet.getName());
|
||||
|
|
|
|||
|
|
@ -2623,6 +2623,14 @@ Wallet.prototype.getTransactionHistoryCsv = function(cb) {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc Sets the version of this wallet object
|
||||
*
|
||||
* @param {string} version - the new version for the wallet
|
||||
*/
|
||||
Wallet.prototype.setVersion = function(version) {
|
||||
this.version = this.opts.version = version;
|
||||
};
|
||||
|
||||
/**
|
||||
* @desc Return a list of past transactions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue