BoostryJP / ibet-Prime

Advanced API Toolkit for Digital Securities Issuance and Management on the ibet Network 🚀
https://ibet.jp/ibet-for-fin
Apache License 2.0
11 stars 1 forks source link

[BUG] ERROR occurs in bond/{tokenAddress}/holders #93

Closed YoshihitoAso closed 3 years ago

YoshihitoAso commented 3 years ago

Describe the bug

│   [2021-04-28 01:33:08 +0000] [20397] [ERROR] Exception in ASGI application                                                                                                                                                              │
│   Traceback (most recent call last):                                                                                                                                                                                                     │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 394, in run_asgi                                                                                                         │
│       result = await app(self.scope, self.receive, self.send)                                                                                                                                                                            │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__                                                                                                         │
│       return await self.app(scope, receive, send)                                                                                                                                                                                        │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/fastapi/applications.py", line 199, in __call__                                                                                                                    │
│       await super().__call__(scope, receive, send)                                                                                                                                                                                       │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/applications.py", line 111, in __call__                                                                                                                  │
│       await self.middleware_stack(scope, receive, send)                                                                                                                                                                                  │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__                                                                                                             │
│       raise exc from None                                                                                                                                                                                                                │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__                                                                                                             │
│       await self.app(scope, receive, _send)                                                                                                                                                                                              │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/middleware/base.py", line 25, in __call__                                                                                                                │
│       response = await self.dispatch_func(request, self.call_next)                                                                                                                                                                       │
│     File "/app/ibet-Prime/app/main.py", line 48, in api_call_handler                                                                                                                                                                     │
│       response = await call_next(request)                                                                                                                                                                                                │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/middleware/base.py", line 45, in call_next                                                                                                               │
│       task.result()                                                                                                                                                                                                                      │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro                                                                                                                    │
│       await self.app(scope, receive, send)                                                                                                                                                                                               │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__                                                                                                                     │
│       raise exc from None                                                                                                                                                                                                                │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__                                                                                                                     │
│       await self.app(scope, receive, sender)                                                                                                                                                                                             │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/routing.py", line 566, in __call__                                                                                                                       │
│       await route.handle(scope, receive, send)                                                                                                                                                                                           │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle                                                                                                                         │
│       await self.app(scope, receive, send)                                                                                                                                                                                               │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/starlette/routing.py", line 41, in app                                                                                                                             │
│       response = await func(request)                                                                                                                                                                                                     │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/fastapi/routing.py", line 209, in app                                                                                                                              │
│       response_data = await serialize_response(                                                                                                                                                                                          │
│     File "/home/apl/.pyenv/versions/3.8.7/lib/python3.8/site-packages/fastapi/routing.py", line 126, in serialize_response                                                                                                               │
│       raise ValidationError(errors, field.type_)                                                                                                                                                                                         │
│   pydantic.error_wrappers.ValidationError: 1 validation error for HolderResponse                                                                                                                                                         │
│   response -> 0 -> pending_transfer                                                                                                                                                                                                      │
│     none is not an allowed value (type=type_error.none.not_allowed) 

Expected behavior

YoshihitoAso commented 3 years ago

Because pending_transfer of data registered with the old TBL definition was set to null. Now it is set uniformly to zero, so there is no problem.