Skip to content

Commit 39fb79a

Browse files
authored
Merge pull request #159 from BoostryJP/loop-test
Add load module for payload timeout verification
2 parents 11faff4 + e3529ce commit 39fb79a

File tree

13 files changed

+130
-14
lines changed

13 files changed

+130
-14
lines changed

ibet-for-fin-network/general/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

ibet-for-fin-network/validator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

ibet-network/general/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

ibet-network/validator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

local-network/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22
services:
33
validator-0:
44
hostname: validator-0
5-
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta1
5+
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta2
66
volumes:
77
- /home/ubuntu/quorum_data/v0:/eth
88
environment:
@@ -24,7 +24,7 @@ services:
2424
restart: always
2525
validator-1:
2626
hostname: validator-1
27-
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta1
27+
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta2
2828
volumes:
2929
- /home/ubuntu/quorum_data/v1:/eth
3030
environment:
@@ -46,7 +46,7 @@ services:
4646
restart: always
4747
validator-2:
4848
hostname: validator-2
49-
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta1
49+
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta2
5050
volumes:
5151
- /home/ubuntu/quorum_data/v2:/eth
5252
environment:
@@ -68,7 +68,7 @@ services:
6868
restart: always
6969
validator-3:
7070
hostname: validator-3
71-
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta1
71+
image: ghcr.io/boostryjp/ibet-localnet/validator:v2.3.0_beta2
7272
volumes:
7373
- /home/ubuntu/quorum_data/v3:/eth
7474
environment:
@@ -90,7 +90,7 @@ services:
9090
restart: always
9191
general-0:
9292
hostname: general-0
93-
image: ghcr.io/boostryjp/ibet-localnet/general:v2.3.0_beta1
93+
image: ghcr.io/boostryjp/ibet-localnet/general:v2.3.0_beta2
9494
volumes:
9595
- /home/ubuntu/quorum_data/g0:/eth
9696
environment:

local-network/general/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

local-network/validator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

test-network/general/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

test-network/validator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git
77

88
RUN git clone https://github.com/BoostryJP/quorum.git && \
99
cd quorum/ && \
10-
git checkout v2.3.0_beta1
10+
git checkout v2.3.0_beta2
1111
RUN cd quorum/ && \
1212
make geth bootnode && \
1313
mv build/bin/geth /usr/local/bin && \

tests/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Used common
2323
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
2424
CONTRACT_PATH = f"{os.path.dirname(__file__)}/contracts"
25-
CONTRACT_NAME = "E2ETest"
25+
CONTRACT_NAME = os.environ.get("CONTRACT_NAME") or "E2ETest"
2626
ACCOUNT_NAME = "test_user"
2727
ACCOUNT_PASSWORD = "password"
2828

tests/contracts/Loop.sol

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright BOOSTRY Co., Ltd.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
*
7+
* You may obtain a copy of the License at
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing,
11+
* software distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
*
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
* SPDX-License-Identifier: Apache-2.0
18+
*/
19+
20+
pragma solidity ^0.8.0;
21+
22+
/// @title Loop 10000
23+
contract Loop {
24+
25+
constructor() {}
26+
27+
/// loop 10000
28+
function loop10000() public {
29+
for (uint256 i = 0; i < 10000; i++) {}
30+
}
31+
}

tests/loop.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"""
2+
Copyright BOOSTRY Co., Ltd.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
7+
You may obtain a copy of the License at
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
SPDX-License-Identifier: Apache-2.0
18+
"""
19+
20+
import secrets
21+
22+
from eth_utils import keccak, to_checksum_address
23+
from coincurve import PublicKey
24+
from web3 import Web3
25+
from web3.middleware import geth_poa_middleware
26+
27+
from tests.config import WEB3_HTTP_PROVIDER, CHAIN_ID, DEPLOYED_CONTRACT_ADDRESS
28+
from tests.util import ContractUtils
29+
30+
contract = ContractUtils.get_contract(DEPLOYED_CONTRACT_ADDRESS)
31+
web3 = Web3(Web3.HTTPProvider(WEB3_HTTP_PROVIDER))
32+
web3.middleware_onion.inject(geth_poa_middleware, layer=0)
33+
web3.strict_bytes_type_checking = False
34+
35+
36+
for i in range(1000):
37+
private_key = keccak(secrets.token_bytes(32))
38+
public_key = PublicKey.from_valid_secret(private_key).format(compressed=False)[1:]
39+
addr = to_checksum_address(keccak(public_key)[-20:])
40+
nonce = web3.eth.get_transaction_count(addr)
41+
tx = contract.functions.loop10000().build_transaction(
42+
transaction={
43+
"chainId": CHAIN_ID,
44+
"from": addr,
45+
"gas": 100000000,
46+
"gasPrice": 0,
47+
"nonce": nonce
48+
}
49+
)
50+
signed_tx = web3.eth.account.sign_transaction(
51+
transaction_dict=tx, private_key=private_key
52+
)
53+
tx_hash = web3.eth.send_raw_transaction(signed_tx.rawTransaction.hex())

tests/loop_deploy.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
Copyright BOOSTRY Co., Ltd.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
7+
You may obtain a copy of the License at
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
SPDX-License-Identifier: Apache-2.0
18+
"""
19+
20+
import os
21+
import sys
22+
23+
path = os.path.join(os.path.dirname(__file__), "../")
24+
sys.path.append(path)
25+
26+
from tests.util import ContractUtils
27+
28+
# Deploy
29+
args = []
30+
contract_address, _, _ = ContractUtils.deploy_contract(args)
31+
32+
print(f"DEPLOYED_CONTRACT_ADDRESS={contract_address}")

0 commit comments

Comments
 (0)