Skip to content

Commit

Permalink
refactor(webapp): remove () from functions with only one parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Nov 3, 2022
1 parent 34ea4b9 commit 3a4dd5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion webapp/src/config/eos.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const endpoint = getEndpoint(
)
export const endpoints = (JSON.parse(
process.env.REACT_APP_EOS_API_HOSTS,
) || []).map((endpoint) =>
) || []).map(endpoint =>
getEndpoint(
process.env.REACT_APP_EOS_API_PROTOCOL,
endpoint || '',
Expand Down
16 changes: 8 additions & 8 deletions webapp/src/utils/eosapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const eosApis = eosConfig.endpoints.map((endpoint) => {
}
})

const callEosApi = async (method) => {
const callEosApi = async method => {
for (let i = 0; i < eosApis.length; i++) {
const diffTime = new Date() - eosApis[i].lastFailureTime

Expand All @@ -32,31 +32,31 @@ const callEosApi = async (method) => {
throw new Error('Each endpoint failed when trying to execute the function')
}

const getAbi = async (account) => {
const getAbi = async account => {
return await callEosApi(async (eosApi) => eosApi.getAbi(account))
}

const getAccount = async (account) => {
const getAccount = async account => {
return await callEosApi(async (eosApi) => eosApi.getAccount(account))
}

const getBlock = async (block) => {
const getBlock = async block => {
return await callEosApi(async (eosApi) => eosApi.getBlock(block))
}

const getCodeHash = async (account) => {
const getCodeHash = async account => {
return await callEosApi(async (eosApi) => eosApi.getCodeHash(account))
}

const getInfo = async (payload) => {
const getInfo = async payload => {
return await callEosApi(async (eosApi) => eosApi.getInfo(payload))
}

const getProducerSchedule = async (payload) => {
const getProducerSchedule = async payload => {
return await callEosApi(async (eosApi) => eosApi.getProducerSchedule(payload))
}

const getTableRows = async (payload) => {
const getTableRows = async payload => {
return await callEosApi(async (eosApi) => eosApi.getTableRows(payload))
}

Expand Down

0 comments on commit 3a4dd5f

Please sign in to comment.