Skip to content
Permalink
Browse files

fix webpack-dev-server version

  • Loading branch information...
SYLing committed Jun 5, 2019
1 parent dba69b0 commit 250ce5e48c9b4d34652fd162cc8e19932c50d1aa
@@ -747,8 +747,8 @@ export const accountOpt=async ({ commit, rootGetters,dispatch },{method,params})
export const _accountOpt=async ({ commit, rootGetters,dispatch },{method,params={}})=>{

helper.trimParams(params);
params.crontab=params.crontab||null;
dispatch("crontab/setCrontab",params.crontab,{root:true});
// params.crontab=params.crontab||null;
// dispatch("crontab/setCrontab",params.crontab,{root:true});

let account=rootGetters["user/getAccountObject"];
if(!account){
@@ -94,23 +94,25 @@ class ChainListener {

let opCount=0;//op counts
//Traversing trx
res.data.transactions.some((trx,trx_index)=>{
//Traversing OP Account record
trx[1].operations.forEach((op,op_index)=>{
this._subscribers.forEach(subscriber => {
subscriber.notify({
block_num:head_block_number,
id:head_block_number+"."+trx_index+"."+op_index,
op,
result:trx[1].operation_results[op_index]
});
});
})
opCount+=trx[1].operations.length;
if(opCount>this.sub_max_ops){
trx[1].operations.length=this.sub_max_ops;
return true;
}
res.data.transactions.some((trx,trx_index)=>{
opCount+=trx[1].operations.length;
if(opCount>this.sub_max_ops){
trx[1].operations.length=this.sub_max_ops;
}
//Traversing OP Account record
trx[1].operations.forEach((op,op_index)=>{
this._subscribers.forEach(subscriber => {
subscriber.notify({
block_num:head_block_number,
id:head_block_number+"."+trx_index+"."+op_index,
op,
result:trx[1].operation_results[op_index]
});
});
})
if(opCount>this.sub_max_ops){
return true;
}
})
}
// subscriber.notify(operation);
@@ -150,37 +150,37 @@ const transactionOp = async (fromId,operations,fromAccount,proposeAccountId="",s
transaction.add_type_operation(op.type, op.opObject);
});

let {crontab}=store.rootState.crontab;
// let {crontab}=store.rootState.crontab;

if(crontab){
await transaction.set_required_fees();
await transaction.update_head_block();
let {startTime,executeInterval,executeTimes}=crontab;

if(startTime==undefined||executeInterval==undefined||executeTimes==undefined){
return {code:101,message:"Crontab parameter is missing"};
}
startTime=parseInt(startTime);
executeInterval=parseInt(executeInterval);
executeTimes=parseInt(executeTimes);
if(isNaN(startTime)||isNaN(executeInterval)||isNaN(executeTimes)){
return {code:1011,message:"Parameter error"};
}

if(startTime<=0||executeInterval<=0||executeTimes<=0){
return {code:176,message:"Crontab must have parameters greater than 0"}
}

let res=await Apis.instance().db_api().exec("get_objects", [["2.1.0"]]);
let now_time=new Date(res[0].time+"Z").getTime();
let crontab_options={
crontab_creator:fromId,
start_time:Math.floor((now_time+startTime)/1000),//+Number(startTime),
execute_interval:executeInterval,
scheduled_execute_times:executeTimes
}
transaction.crontab(crontab_options)
}
// if(crontab){
// await transaction.set_required_fees();
// await transaction.update_head_block();
// let {startTime,executeInterval,executeTimes}=crontab;

// if(startTime==undefined||executeInterval==undefined||executeTimes==undefined){
// return {code:101,message:"Crontab parameter is missing"};
// }
// startTime=parseInt(startTime);
// executeInterval=parseInt(executeInterval);
// executeTimes=parseInt(executeTimes);
// if(isNaN(startTime)||isNaN(executeInterval)||isNaN(executeTimes)){
// return {code:1011,message:"Parameter error"};
// }

// if(startTime<=0||executeInterval<=0||executeTimes<=0){
// return {code:176,message:"Crontab must have parameters greater than 0"}
// }

// let res=await Apis.instance().db_api().exec("get_objects", [["2.1.0"]]);
// let now_time=new Date(res[0].time+"Z").getTime();
// let crontab_options={
// crontab_creator:fromId,
// start_time:Math.floor((now_time+startTime)/1000),//+Number(startTime),
// execute_interval:executeInterval,
// scheduled_execute_times:executeTimes
// }
// transaction.crontab(crontab_options)
// }

if(proposeAccountId){
await transaction.set_required_fees();
@@ -19,7 +19,7 @@ export const publishVotes=(store,witnesses_ids,committee_ids,new_proxy_id,callba

let {vote_ids}=getters.getVotesState;

new_options.voting_account = new_proxy_id ? new_proxy_id : "1.2.5";
new_options.voting_account = new_proxy_id ? new_proxy_id : "1.2.2";
new_options.num_witness = witnesses_ids.length;
new_options.num_committee = committee_ids.length;

@@ -184,7 +184,7 @@ const updateAccountData=async (store,type)=>{
account=account.data.account;
account=Immutable.fromJS(account);
let proxyId=account.getIn(["options","voting_account"]);
let proxy_account_id=proxyId === "1.2.5" ? "" : proxyId;
let proxy_account_id=proxyId === "1.2.2" ? "" : proxyId;
let proxy=null;
if(proxy_account_id){
proxy=await API.Account.getUser(proxy_account_id,false);
@@ -200,7 +200,7 @@ const updateAccountData=async (store,type)=>{
let proxyOptions = proxy ? proxy.get("options") : null;
let current_proxy_input = proxy ? proxy.get("name") : "";

if (proxy_account_id === "1.2.5") {
if (proxy_account_id === "1.2.2") {
proxy_account_id = "";
current_proxy_input = "";
}
@@ -214,7 +214,7 @@ const updateAccountData=async (store,type)=>{

let proxyPromise = null,
proxy_vids = Immutable.Set([]);
const hasProxy = proxy_account_id !== "1.2.5";
const hasProxy = proxy_account_id !== "1.2.2";
if (hasProxy && proxyOptions) {
let proxy_votes = proxyOptions.get("votes");
let proxy_vote_ids = proxy_votes.toArray();
@@ -68,7 +68,7 @@
"vuex": "^3.0.1",
"webpack": "^4.0.1",
"webpack-cli": "3.1.2",
"webpack-dev-server": "3.1.0",
"webpack-dev-server": "3.1.11",
"bcl-worker-loader": "^1.0.0",
"cross-env": "^5.0.1"
},
@@ -747,8 +747,8 @@ export const accountOpt=async ({ commit, rootGetters,dispatch },{method,params})
export const _accountOpt=async ({ commit, rootGetters,dispatch },{method,params={}})=>{

helper.trimParams(params);
params.crontab=params.crontab||null;
dispatch("crontab/setCrontab",params.crontab,{root:true});
// params.crontab=params.crontab||null;
// dispatch("crontab/setCrontab",params.crontab,{root:true});

let account=rootGetters["user/getAccountObject"];
if(!account){
@@ -94,7 +94,11 @@ class ChainListener {

let opCount=0;//op counts
//Traversing trx
res.data.transactions.some((trx,trx_index)=>{
res.data.transactions.some((trx,trx_index)=>{
opCount+=trx[1].operations.length;
if(opCount>this.sub_max_ops){
trx[1].operations.length=this.sub_max_ops;
}
//Traversing OP Account record
trx[1].operations.forEach((op,op_index)=>{
this._subscribers.forEach(subscriber => {
@@ -106,9 +110,7 @@ class ChainListener {
});
});
})
opCount+=trx[1].operations.length;
if(opCount>this.sub_max_ops){
trx[1].operations.length=this.sub_max_ops;
return true;
}
})
@@ -116,7 +116,7 @@ class UserOperations extends Subscription {

notify(operation) {
if(operation&&operation.op){
const _userOperationsCodes =[0, 1, 2,3,4,5,6,8,10,11,14,15,16,21,22,42,47,49,50,51,52,53,54,55,56,57,58,59,63];
const _userOperationsCodes =[0, 1, 2,3,4,5,6,8,10,11,14,15,16,21,22,42,44,47,49,50,51,52,53,54,55,56,57,58,59,63];
const _opCode = operation.op[0];
if (_userOperationsCodes.indexOf(_opCode) > -1) {
const usersIds = this._getOperationUserIds(operation);
@@ -151,37 +151,37 @@ const transactionOp = async (fromId,operations,fromAccount,proposeAccountId="",s
transaction.add_type_operation(op.type, op.opObject);
});

let {crontab}=store.rootState.crontab;
// let {crontab}=store.rootState.crontab;

if(crontab){
await transaction.set_required_fees();
await transaction.update_head_block();
let {startTime,executeInterval,executeTimes}=crontab;

if(startTime==undefined||executeInterval==undefined||executeTimes==undefined){
return {code:101,message:"Crontab parameter is missing"};
}
startTime=parseInt(startTime);
executeInterval=parseInt(executeInterval);
executeTimes=parseInt(executeTimes);
if(isNaN(startTime)||isNaN(executeInterval)||isNaN(executeTimes)){
return {code:1011,message:"Parameter error"};
}

if(startTime<=0||executeInterval<=0||executeTimes<=0){
return {code:176,message:"Crontab must have parameters greater than 0"}
}

let res=await Apis.instance().db_api().exec("get_objects", [["2.1.0"]]);
let now_time=new Date(res[0].time+"Z").getTime();
let crontab_options={
crontab_creator:fromId,
start_time:Math.floor((now_time+startTime)/1000),//+Number(startTime),
execute_interval:executeInterval,
scheduled_execute_times:executeTimes
}
transaction.crontab(crontab_options)
}
// if(crontab){
// await transaction.set_required_fees();
// await transaction.update_head_block();
// let {startTime,executeInterval,executeTimes}=crontab;

// if(startTime==undefined||executeInterval==undefined||executeTimes==undefined){
// return {code:101,message:"Crontab parameter is missing"};
// }
// startTime=parseInt(startTime);
// executeInterval=parseInt(executeInterval);
// executeTimes=parseInt(executeTimes);
// if(isNaN(startTime)||isNaN(executeInterval)||isNaN(executeTimes)){
// return {code:1011,message:"Parameter error"};
// }

// if(startTime<=0||executeInterval<=0||executeTimes<=0){
// return {code:176,message:"Crontab must have parameters greater than 0"}
// }

// let res=await Apis.instance().db_api().exec("get_objects", [["2.1.0"]]);
// let now_time=new Date(res[0].time+"Z").getTime();
// let crontab_options={
// crontab_creator:fromId,
// start_time:Math.floor((now_time+startTime)/1000),//+Number(startTime),
// execute_interval:executeInterval,
// scheduled_execute_times:executeTimes
// }
// transaction.crontab(crontab_options)
// }

if(proposeAccountId){
await transaction.set_required_fees();
@@ -19,7 +19,7 @@ export const publishVotes=(store,witnesses_ids,committee_ids,new_proxy_id,callba

let {vote_ids}=getters.getVotesState;

new_options.voting_account = new_proxy_id ? new_proxy_id : "1.2.5";
new_options.voting_account = new_proxy_id ? new_proxy_id : "1.2.2";
new_options.num_witness = witnesses_ids.length;
new_options.num_committee = committee_ids.length;

@@ -184,7 +184,7 @@ const updateAccountData=async (store,type)=>{
account=account.data.account;
account=Immutable.fromJS(account);
let proxyId=account.getIn(["options","voting_account"]);
let proxy_account_id=proxyId === "1.2.5" ? "" : proxyId;
let proxy_account_id=proxyId === "1.2.2" ? "" : proxyId;
let proxy=null;
if(proxy_account_id){
proxy=await API.Account.getUser(proxy_account_id,false);
@@ -200,7 +200,7 @@ const updateAccountData=async (store,type)=>{
let proxyOptions = proxy ? proxy.get("options") : null;
let current_proxy_input = proxy ? proxy.get("name") : "";

if (proxy_account_id === "1.2.5") {
if (proxy_account_id === "1.2.2") {
proxy_account_id = "";
current_proxy_input = "";
}
@@ -214,7 +214,7 @@ const updateAccountData=async (store,type)=>{

let proxyPromise = null,
proxy_vids = Immutable.Set([]);
const hasProxy = proxy_account_id !== "1.2.5";
const hasProxy = proxy_account_id !== "1.2.2";
if (hasProxy && proxyOptions) {
let proxy_votes = proxyOptions.get("votes");
let proxy_vote_ids = proxy_votes.toArray();
@@ -14,6 +14,7 @@ module.exports = {
devServer: {
host: "0.0.0.0",
port: 1086,
disableHostCheck:true
},
module: {
rules: [

0 comments on commit 250ce5e

Please sign in to comment.
You can’t perform that action at this time.