-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POST match2/{id}/proposal
+ GET match2/{id}/proposal
+ `GET match2…
…/{id}/proposal/{id}` (#34) * create get local match2 * v bump * missing test * create -> propose * typos * WIP * wip * tests passing * no token id 400 tests * payload improvements * transaction routes * clean up * v bump * return columns * remove unused query * check demand status * reduce identity service calls * add status checks on chain creation * review comments * identity service format
- Loading branch information
1 parent
9572306
commit f59c3ea
Showing
17 changed files
with
498 additions
and
129 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
// a temporary placeholder for the blockchain watcher | ||
|
||
import { UUID } from '../../models/uuid' | ||
import { TransactionState } from '../../models/transaction' | ||
import { TokenType } from '../../models/tokenType' | ||
import Database from '../db' | ||
|
||
const db = new Database() | ||
|
||
const typeTableMap = { | ||
[TokenType.DEMAND]: 'demand', | ||
[TokenType.MATCH2]: 'match2', | ||
} | ||
|
||
export const observeTokenId = async ( | ||
db: Database, | ||
tokenType: TokenType, | ||
transactionId: UUID, | ||
tokenId: number, | ||
isNewEntity: boolean | ||
) => { | ||
const [{ localId }] = await db.updateTransaction(transactionId, { | ||
state: TransactionState.finalised, | ||
token_id: tokenId, | ||
}) | ||
|
||
export const observeTokenId = async (tokenType: TokenType, localId: UUID, tokenId: number, isNewEntity: boolean) => { | ||
await db.updateLocalWithTokenId(typeTableMap[tokenType], localId, tokenId, isNewEntity) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.