diff --git a/kleros-sdk/src/dataMappings/actions/callAction.ts b/kleros-sdk/src/dataMappings/actions/callAction.ts index 24cb7a170..256696551 100644 --- a/kleros-sdk/src/dataMappings/actions/callAction.ts +++ b/kleros-sdk/src/dataMappings/actions/callAction.ts @@ -8,12 +8,12 @@ export const callAction = async (mapping: AbiCallMapping) => { const publicClient = getPublicClient(); const { abi: source, address, args, seek, populate } = mapping; - let parsedAbi = typeof source === "string" ? parseAbiItem(source) : source; + const parsedAbi = typeof source === "string" ? parseAbiItem(source) : source; const data = await publicClient.readContract({ - address: address, + address, abi: [parsedAbi], - args: args, + args, }); return createResultObject(data, seek, populate); diff --git a/kleros-sdk/src/dataMappings/actions/eventAction.ts b/kleros-sdk/src/dataMappings/actions/eventAction.ts index 02273fa79..ac02ef8d8 100644 --- a/kleros-sdk/src/dataMappings/actions/eventAction.ts +++ b/kleros-sdk/src/dataMappings/actions/eventAction.ts @@ -8,10 +8,10 @@ export const eventAction = async (mapping: AbiEventMapping) => { const publicClient = getPublicClient(); const { abi: source, address, eventFilter, seek, populate } = mapping; - let parsedAbi = typeof source === "string" ? parseAbiItem(source) : source; + const parsedAbi = typeof source === "string" ? parseAbiItem(source) : source; const filter = await publicClient.createEventFilter({ - address: address, + address, event: parsedAbi, args: eventFilter.args, fromBlock: eventFilter.fromBlock, diff --git a/kleros-sdk/src/dataMappings/executeActions.ts b/kleros-sdk/src/dataMappings/executeActions.ts index a6fda7969..049c31a87 100644 --- a/kleros-sdk/src/dataMappings/executeActions.ts +++ b/kleros-sdk/src/dataMappings/executeActions.ts @@ -38,7 +38,7 @@ export const executeAction = async (mapping: ActionMapping, context = {}) => { }; export const executeActions = async (mappings, initialContext = {}) => { - let context = { ...initialContext }; + const context = { ...initialContext }; for (const mapping of mappings) { const actionResult = await executeAction(mapping, context); diff --git a/kleros-sdk/src/dataMappings/retrieveRealityData.ts b/kleros-sdk/src/dataMappings/retrieveRealityData.ts index 58314e190..d7004693d 100644 --- a/kleros-sdk/src/dataMappings/retrieveRealityData.ts +++ b/kleros-sdk/src/dataMappings/retrieveRealityData.ts @@ -102,6 +102,6 @@ export const retrieveRealityData = async (realityQuestionID: string, arbitrable? realityAddress: questionData.arbitrator, questionId: questionData.realityQuestionID, realityUser: questionData.realityUser, - answers: answers, + answers, }; }; diff --git a/kleros-sdk/src/dataMappings/utils/createResultObject.ts b/kleros-sdk/src/dataMappings/utils/createResultObject.ts index 7a76f9f6d..cc910c063 100644 --- a/kleros-sdk/src/dataMappings/utils/createResultObject.ts +++ b/kleros-sdk/src/dataMappings/utils/createResultObject.ts @@ -1,6 +1,6 @@ // Can this be replaced by Mustache ? export const createResultObject = (sourceData, seek, populate) => { - let result = {}; + const result = {}; seek.forEach((key, idx) => { let foundValue; if (typeof sourceData !== "object" || key === "0") { diff --git a/kleros-sdk/test/dataMappings.test.ts b/kleros-sdk/test/dataMappings.test.ts index 6c31b664c..bd2730b3f 100644 --- a/kleros-sdk/test/dataMappings.test.ts +++ b/kleros-sdk/test/dataMappings.test.ts @@ -51,11 +51,11 @@ describe("subgraphAction with variables", () => { const mapping = { type: "graphql", - endpoint: endpoint, - query: query, - variables: variables, - seek: seek, - populate: populate, + endpoint, + query, + variables, + seek, + populate, }; const result = await subgraphAction(mapping); @@ -78,7 +78,7 @@ describe("callAction", () => { const mapping = { type: "abi/call", - abi: abi, + abi, address: contractAddress, args: [knownAddress], seek: [""], @@ -104,8 +104,8 @@ describe("eventAction", () => { abi: eventAbi, address: contractAddress, eventFilter: { - fromBlock: fromBlock, - toBlock: toBlock, + fromBlock, + toBlock, }, seek: ["from", "to", "value"], populate: ["fromAddress", "toAddress", "transferValue"], @@ -128,9 +128,9 @@ describe("fetchIpfsJsonAction", () => { const mapping = { type: "fetch/ipfs/json", - ipfsUri: ipfsUri, - seek: seek, - populate: populate, + ipfsUri, + seek, + populate, }; const result = await fetchIpfsJsonAction(mapping);