Setup of Ethereum Tester For Blockchain Testing

Posted By : Sonali Gupta | 16-Apr-2018

How to test the Blockchain Application

 

Blockchain will contain the list of records for securing the cryptography known as blocks. Each block having its unique crytographic hash for earlier blocks also verifies and view transaction details between two partners. Blockchain managed by the peer-to-peer network for addressing a protocol for generating the new blocks.

 

Related to the functionality of blockchain the testing of the website takes place, which the test engineer do the functional, integration testing, performance testing (Jmeter tool require) and security testing.

 

Ethereum Testing Tools (To Run Code)

Ethereum Tester:- Some codes are run to test the cases click on the link Ethereum Tester provide a tool for testing the Ethereum-based application.

 

Input/output data format:-

 

The ethereum library will use the following format.

  • Hexadecimal values are text (not byte) strings.

  • The address consists of mixed- alpha characters which validate the checksummed address which is specified by EIP-55

  • 32-byte of hashcode will be hexadecimal encoded.

  • Numeric values will provide integer representation.

Block Number:-

The parameter will accept the following string value.

  • 'latest': for latest mined blocks.

  • 'pending': for current un-mined blocks.

  • 'earliest': for genesis blocks.

 

Installation Code:- pip install eth-tester

 

Development code:- pip install -e . -r requirements-dev.txt

 

Run the code to test:- py.test tests

Or you can install tox to run the test suite.

 

Ethereum Tester API used for automating the scripts:-

 

1. eth_tester.EthereumTester(backend=None, validator=None, normalizer=None, auto_mine_transactions=True, fork_blocks=None)

2. backend: The chain backend being used.

3. validator: The validator use.

4. normalizer: The normalizer to used.

5. auto_mine_transactions: Transactions will automatically

  • enable auto mine transactions

  • disable auto mine transactions

6. fork_blocks: Various Block numbers will get activated which consist of block network.

 

Transaction Sending:-

 

1. from:- The address account used to provide sending transaction details(hexadecimal string).

2. to:- The address account used to provide transaction, which is being sent to. Empty string used to switch towards contract creation (hexadecimal string).

3. gas:- It will Set the gas limit for transaction detail executed (integer).

4. gas_price:- Set the price per unit of gas in wei that will be paid for transaction detail executed (integer).

5. value:- The amount of ether in wei that sent to others which provide transaction details (integer).

6. data:- Provide balance detail of transaction (hexadecimal string)

About Author

Author Image
Sonali Gupta

Sonali is certified in manual testing and selenium web driver. She is a B.Tech through Electronics and Communication.

Request for Proposal

Name is required

Comment is required

Sending message..