Skip to content

Commit

Permalink
Merge pull request #979 from BoostryJP/Release
Browse files Browse the repository at this point in the history
Release v21.4.0
  • Loading branch information
YoshihitoAso authored Apr 30, 2021
2 parents 7fe06f8 + 9bad0b1 commit 8b34440
Show file tree
Hide file tree
Showing 108 changed files with 4,467 additions and 2,805 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

* OS: macOS 10.14 (Mojave)
* PostgreSQL: 10.13 or MySQL: 5.7
* Python: 3.6.8
* Python: 3.8.7

## 1. PostgreSQL

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~apl/.bash_profile \

# install python
RUN . ~/.bash_profile \
&& pyenv install 3.6.13 \
&& pyenv global 3.6.13 \
&& pyenv install 3.8.7 \
&& pyenv global 3.8.7 \
&& pip install --upgrade pip

# install python packages
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ibet Wallet API

<p>
<img alt="Version" src="https://img.shields.io/badge/version-21.3-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-21.4-blue.svg?cacheSeconds=2592000" />
<a href="https:/doc.com" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
Expand Down
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
SPDX-License-Identifier: Apache-2.0
"""
__version__ = '21.3.0'
__version__ = '21.4.0'
22 changes: 13 additions & 9 deletions app/api/v2/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,32 @@
SPDX-License-Identifier: Apache-2.0
"""

import json
import requests

from eth_utils import to_checksum_address
from sqlalchemy import desc
from web3 import Web3

from app import log
from app.api.common import BaseResource
from app.errors import AppError, InvalidParameterError, DataNotExistsError
from app.errors import (
AppError,
InvalidParameterError,
DataNotExistsError
)
from app import config
from app.contracts import Contract
from app.model import Listing, BondToken, MembershipToken, CouponToken, ShareToken
from app.model import (
Listing,
BondToken,
MembershipToken,
CouponToken,
ShareToken
)

LOG = log.get_logger()

from web3 import Web3
from web3.middleware import geth_poa_middleware

web3 = Web3(Web3.HTTPProvider(config.WEB3_HTTP_PROVIDER))
web3.middleware_stack.inject(geth_poa_middleware, layer=0)


# ------------------------------
# 発行会社情報参照
Expand Down
19 changes: 11 additions & 8 deletions app/api/v2/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,25 @@
SPDX-License-Identifier: Apache-2.0
"""

from cerberus import Validator

from web3 import Web3
from web3.geth import GethTxPool
from web3.middleware import geth_poa_middleware
from web3.utils.threads import Timeout
from web3.exceptions import TimeExhausted
from eth_account import Account
from eth_typing import ChecksumAddress

from eth_utils import to_checksum_address
from rlp import decode
from hexbytes import HexBytes

from app import log
from app.api.common import BaseResource
from app.errors import InvalidParameterError, SuspendedTokenError, DataNotExistsError, ServiceUnavailable
from app.errors import (
InvalidParameterError,
SuspendedTokenError,
DataNotExistsError,
ServiceUnavailable
)
from app import config
from app.model import ExecutableContract, Listing
from app.contracts import Contract
Expand All @@ -40,7 +43,7 @@
LOG = log.get_logger()

web3 = Web3(Web3.HTTPProvider(config.WEB3_HTTP_PROVIDER))
web3.middleware_stack.inject(geth_poa_middleware, layer=0)
web3.middleware_onion.inject(geth_poa_middleware, layer=0)


# ------------------------------
Expand Down Expand Up @@ -190,7 +193,7 @@ def on_post(self, req, res):
# Handling a transaction execution result
try:
tx = web3.eth.waitForTransactionReceipt(tx_hash, timeout=config.TRANSACTION_WAIT_TIMEOUT)
except Timeout as err:
except TimeExhausted as err:
status = 2 # execution success (pending transaction)

# Transactions that are not promoted to pending and remain in the queued state
Expand All @@ -202,7 +205,7 @@ def on_post(self, req, res):
LOG.error(f"get sender address from signed transaction failed: {err}")
continue
nonce = int("0x0" if raw_tx[0].hex() == "" else raw_tx[0].hex(), 16)
txpool_inspect = web3.txpool.inspect
txpool_inspect = GethTxPool.inspect
if from_address in txpool_inspect.queued:
if str(nonce) in txpool_inspect.queued[from_address]:
status = 0 # execution failure
Expand Down
Loading

0 comments on commit 8b34440

Please sign in to comment.