Skip to content

Commit

Permalink
Merge branch 'main' into feat-detokanize-amount-on-warehouse
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstefanequilobe committed Nov 7, 2022
2 parents a91fa0e + 97e4db4 commit 0829974
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ const confirmTokenRegistrationOnWarehouse = async (
) => {
if (retry <= 60) {
try {
await new Promise((resolve) => setTimeout(() => resolve(), 30000));

const thereAreNoPendingTransactions =
await warehouseApi.getHasPendingTransactions();

Expand Down Expand Up @@ -262,6 +264,8 @@ const confirmTokenCreationWithTransactionId = async (
) => {
if (retry <= 60) {
try {
await new Promise((resolve) => setTimeout(() => resolve(), 30000));

const response = await request({
method: "get",
url: `${CONFIG.TOKENIZE_DRIVER_HOST}/v1/transactions/${transactionId}`,
Expand Down Expand Up @@ -300,7 +304,7 @@ app.post("/tokenize", validator.body(tokenizeUnitSchema), async (req, res) => {
sequence_num: req.body.sequence_num,
},
payment: {
amount: 100,
amount: (req.body.amount || 1) * 1000,
fee: 100,
to_address: req.body.to_address,
},
Expand Down
1 change: 1 addition & 0 deletions validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const tokenizeUnitSchema = Joi.object({
sequence_num: Joi.number().required(),
warehouseUnitId: Joi.string().required(),
to_address: Joi.string().required(),
amount: Joi.number().required(),
});

const compressedProtectedFileSchema = Joi.object({
Expand Down

0 comments on commit 0829974

Please sign in to comment.