Skip to content

Commit

Permalink
fix: conform with aggregation spec namings (#23)
Browse files Browse the repository at this point in the history
* fix: remove md5 (#20)

* fix: integration tests
  • Loading branch information
vasco-santos authored Jun 1, 2023
1 parent ee5d0b0 commit e4af788
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions data/tables/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export function createCarTable (region, tableName, options = {}) {
Item: {
link: { 'S': car.link },
size: { 'N': `${car.size}`},
url: { 'S': car.url },
commP: { 'S': car.commP },
src: { 'SS': car.src },
commitmentProof: { 'S': car.commitmentProof },
insertedAt: { 'S': insertedAt },
},
ConditionExpression: 'attribute_not_exists(link)',
Expand Down
6 changes: 3 additions & 3 deletions data/tables/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const carTableProps = {
fields: {
link: 'string', // `bagy...1`
size: 'number', // `101`
url: 'string', // `https://...`
commP: 'string', // `commP...a`
src: 'string', // `https://...`
commitmentProof: 'string', // `commitmentProof...a`
insertedAt: 'string', // `2023-01-17T...`
},
// link
Expand All @@ -20,7 +20,7 @@ export const ferryTableProps = {
size: 'number', // `101`
// Note: `state` and `status` are reserved keywords in dynamodb
stat: 'string', // 'LOADING' | 'READY' | 'DEAL_PENDING' | 'DEAL_PROCESSED'
commP: 'string', // `commP...a`
commitmentProof: 'string', // `commitmentProof...a`
insertedAt: 'string', // `2023-01-17T...`
},
// link
Expand Down
4 changes: 2 additions & 2 deletions data/test/tables/car.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ test('can add cars to table uniquely', async (t) => {
const cars = (await getCars(10)).map(car => ({
link: car.link.toString(),
size: car.size,
commP: 'commP',
url: 'url',
commitmentProof: 'commitmentProof',
src: ['url'],
}))

await carTable.batchWrite(cars)
Expand Down
4 changes: 2 additions & 2 deletions data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export type FerryState = 'LOADING' | 'READY' | 'DEAL_PENDING' | 'DEAL_PROCESSED'
export interface CarItem {
link: string
size: number
commP: string
url: string
commitmentProof: string
src: string[]
}

export interface CarItemFerry {
Expand Down
4 changes: 2 additions & 2 deletions test/data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ async function getBatchesToWrite (length, batchSize) {
return cars.map(car => ({
link: car.link.toString(),
size: car.size,
commP: 'commP',
url: 'url',
commitmentProof: 'commitmentProof',
src: ['url'],
}))
})
)
Expand Down

0 comments on commit e4af788

Please sign in to comment.