Skip to content
Snippets Groups Projects
Commit 2ddd4c6e authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Refactoring: type FileDAL.myFS

parent 930f9783
Branches
Tags
No related merge requests found
......@@ -59,7 +59,6 @@ export interface FileDALParams {
export class FileDAL {
rootPath:string
myFS:any
sqliteDriver:SQLiteDriver
wotb:any
profile:string
......@@ -87,19 +86,18 @@ export class FileDAL {
constructor(params:FileDALParams) {
this.rootPath = params.home
this.myFS = params.fs
this.sqliteDriver = params.dbf()
this.wotb = params.wotb
this.profile = 'DAL'
// DALs
this.powDAL = new PowDAL(this.rootPath, this.myFS)
this.confDAL = new ConfDAL(this.rootPath, this.myFS)
this.powDAL = new PowDAL(this.rootPath, params.fs)
this.confDAL = new ConfDAL(this.rootPath, params.fs)
this.metaDAL = new (require('./sqliteDAL/MetaDAL').MetaDAL)(this.sqliteDriver);
this.peerDAL = new (require('./sqliteDAL/PeerDAL').PeerDAL)(this.sqliteDriver);
this.blockDAL = new (require('./sqliteDAL/BlockDAL').BlockDAL)(this.sqliteDriver);
this.txsDAL = new (require('./sqliteDAL/TxsDAL').TxsDAL)(this.sqliteDriver);
this.statDAL = new StatDAL(this.rootPath, this.myFS)
this.statDAL = new StatDAL(this.rootPath, params.fs)
this.idtyDAL = new (require('./sqliteDAL/IdentityDAL').IdentityDAL)(this.sqliteDriver);
this.certDAL = new (require('./sqliteDAL/CertDAL').CertDAL)(this.sqliteDriver);
this.msDAL = new (require('./sqliteDAL/MembershipDAL').MembershipDAL)(this.sqliteDriver);
......
......@@ -13,13 +13,15 @@
import {CFSCore} from "./CFSCore";
import {Initiable} from "../sqliteDAL/Initiable"
import {FileSystem} from "../../system/directory"
import {FileDAL} from "../fileDAL"
export abstract class AbstractCFS extends Initiable {
public coreFS:CFSCore
protected dal:any
protected dal:FileDAL
constructor(rootPath:string, qioFS:any) {
constructor(rootPath:string, qioFS:FileSystem) {
super()
this.coreFS = new CFSCore(rootPath, qioFS)
}
......
......@@ -14,6 +14,7 @@
import {AbstractCFS} from "./AbstractCFS"
import {ConfDTO} from "../../dto/ConfDTO"
import {CommonConstants} from "../../common-libs/constants";
import {FileSystem} from "../../system/directory"
const _ = require('underscore');
......@@ -21,7 +22,7 @@ export class ConfDAL extends AbstractCFS {
private logger:any
constructor(rootPath:string, qioFS:any) {
constructor(rootPath:string, qioFS:FileSystem) {
super(rootPath, qioFS)
this.logger = require('../../logger').NewLogger()
}
......
......@@ -12,12 +12,13 @@
// GNU Affero General Public License for more details.
import {AbstractCFS} from "./AbstractCFS"
import {FileSystem} from "../../system/directory"
export class PowDAL extends AbstractCFS {
private static POW_FILE = "pow.txt"
constructor(rootPath:string, qioFS:any) {
constructor(rootPath:string, qioFS:FileSystem) {
super(rootPath, qioFS)
}
......
......@@ -12,12 +12,13 @@
// GNU Affero General Public License for more details.
import {AbstractCFS} from "./AbstractCFS";
import {CFSCore} from "./CFSCore";
import {FileSystem} from "../../system/directory"
const _ = require('underscore');
export class StatDAL extends AbstractCFS {
constructor(rootPath:string, qioFS:any) {
constructor(rootPath:string, qioFS:FileSystem) {
super(rootPath, qioFS)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment