Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async model() {
const wallet = this.modelFor('wallets');
const account = this.modelFor('wallets.overview.accounts');
const history = await this.store.query('history', {
account: get(account, 'id'),
count: 100,
});
return hash({
wallet,
account,
history,
});
}
asyncHashTask: task(function * (tasks) {
return yield hash(tasks);
}),
compute([tasks/*, ...rest*/]/*, hash*/) {
model() {
const wallet = this.modelFor('wallets/overview');
const seed = this.get('rpc').walletSeed(get(wallet, 'id'));
return hash({
wallet,
seed,
});
}
async findRecord(store, type, id, snapshot) {
const rpc = this.get('rpc');
const { wallet } = this.serialize(snapshot, { includeId: true });
const { representative, accounts } = await hash({
representative: rpc.walletRepresentative(wallet),
accounts: rpc.accountList(wallet),
});
return { wallet, representative, accounts };
}
model() {
const wallet = this.modelFor('setup').save();
const seed = generateSeed();
return hash({
wallet,
seed,
});
}
return this.runTask(() => {
const rpc = this.get('rpc');
const blocks = rpc.blockCount();
const peers = rpc.peers().then(p => Object.keys(p));
const promise = hash({
blocks,
peers,
});
set(this, 'promise', promise);
return this.runTask(next, STATUS_POLL_INTERVAL);
});
}