Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Jan 23, 2024
1 parent d91cab7 commit 7001003
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions kleros-sdk/src/dataMappings/actions/callAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions kleros-sdk/src/dataMappings/actions/eventAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion kleros-sdk/src/dataMappings/executeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion kleros-sdk/src/dataMappings/retrieveRealityData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ export const retrieveRealityData = async (realityQuestionID: string, arbitrable?
realityAddress: questionData.arbitrator,
questionId: questionData.realityQuestionID,
realityUser: questionData.realityUser,
answers: answers,
answers,
};
};
2 changes: 1 addition & 1 deletion kleros-sdk/src/dataMappings/utils/createResultObject.ts
Original file line number Diff line number Diff line change
@@ -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") {
Expand Down
22 changes: 11 additions & 11 deletions kleros-sdk/test/dataMappings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -78,7 +78,7 @@ describe("callAction", () => {

const mapping = {
type: "abi/call",
abi: abi,
abi,
address: contractAddress,
args: [knownAddress],
seek: [""],
Expand All @@ -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"],
Expand All @@ -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);
Expand Down

0 comments on commit 7001003

Please sign in to comment.