Skip to content

Commit 3fa8460

Browse files
authored
Merge pull request #12 from kleros/feat/update-tables
feat(justifications): use different tables for network
2 parents a888d0d + 0c8ec94 commit 3fa8460

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

serverless.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,12 @@ functions:
251251
- {
252252
Effect: Allow,
253253
Action: ['dynamodb:Query'],
254-
Resource: 'arn:aws:dynamodb:us-east-2:547511976516:table/justifications',
254+
Resource: 'arn:aws:dynamodb:us-east-2:547511976516:table/kovan-justifications',
255+
}
256+
- {
257+
Effect: Allow,
258+
Action: ['dynamodb:Query'],
259+
Resource: 'arn:aws:dynamodb:us-east-2:547511976516:table/mainnet-justifications',
255260
}
256261
documentation:
257262
summary: 'Get justifications for a dispute round.'
@@ -290,7 +295,12 @@ functions:
290295
- {
291296
Effect: Allow,
292297
Action: ['dynamodb:PutItem'],
293-
Resource: 'arn:aws:dynamodb:us-east-2:547511976516:table/justifications',
298+
Resource: 'arn:aws:dynamodb:us-east-2:547511976516:table/kovan-justifications',
299+
}
300+
- {
301+
Effect: Allow,
302+
Action: ['dynamodb:PutItem'],
303+
Resource: 'arn:aws:dynamodb:us-east-2:547511976516:table/mainnet-justifications',
294304
}
295305
documentation:
296306
summary: 'Put justification for a vote.'

src/court/justifications.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports.get = async (event, _context, callback) => {
1717
}
1818
},
1919
KeyConditionExpression: 'disputeIDAndAppeal = :disputeIDAndAppeal',
20-
TableName: 'justifications'
20+
TableName: `${payload.network}-justifications`
2121
})
2222
}
2323
})
@@ -96,7 +96,7 @@ module.exports.put = async (event, _context, callback) => {
9696
},
9797
justification: { S: payload.justification.justification }
9898
},
99-
TableName: 'justifications'
99+
TableName: `${payload.network}-justifications`
100100
})
101101
callback(null, {
102102
statusCode: 200,

0 commit comments

Comments
 (0)