import Vue from 'vue';
const state = {
  proofCount: 0,
};
const getters = {

};
const mutations = {
  updateProofCount(state: any, payload: any) {
    state.proofCount = payload;
  },
};
const actions = {
  getProofCount( { commit }: any ) {
    Vue.prototype.$api.proof.count().then((res: any) => {
      commit('updateProofCount', res.total);
    }).catch((err: any) => {
      commit('updateProofCount', 0);
    });
  },
};
const namespaced: boolean = true;
export const proof = {
  namespaced,
  state,
  getters,
  mutations,
  actions,
};
