Skip to content

Commit

Permalink
fix(sudt): error amount
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl-L committed Jan 10, 2024
1 parent 1f71795 commit a35f270
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/samples/sudt/src/controllers/sudt.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default class SudtController extends BaseController {
.save(this._dataSource.getRepository(Account).create({ address: req.account }))
}

const amount = BI.isBI(req.amount) ? BI.from(req.amount) : BI.from(0)
try {
const amount = BI.from(req.amount)
const lockModel = LockModel.getLock(req.account)

const { typeScript, ...result } = lockModel.mint(getLock(req.account), amount)
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class SudtController extends BaseController {
}

console.error(e)
throw e
return SudtResponse.err('500', { message: (e as Error).message })
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/samples/sudt/src/tasks/token.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class TokenTask {
if (Date.now() - token.createdAt.getTime() > this._maxTimeFromCreate) {
continue
}
console.log(Date.now(), token.createdAt.getTime())
try {
await this._explorerService.updateSUDT({
typeHash: token.typeId,
Expand Down

0 comments on commit a35f270

Please sign in to comment.