Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unit tests for coin.js #1150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on May 6, 2023

  1. Added unit tests for coin,js

    Line 52:
    Each assertion here will throw an error if input type is not valid. For example, version must be a number
    
    Line 61:
    Here we are calculating number of confirmations for a transaction output based on current block height. In the case used here, if the coin height is 100 and current block height is 99, the depth should be 0. If the current block height is 101, the depth should be 2.
    
    Line 77: 
    Here firstly a coin object is created with all the valid attributes such as version, height etc. It then converts the coin object to JSON format using .toJSON() and then creates new coin object by converting JSON back using .fromJSON. This makes sure serialization and deserialization functions are working properly.
    
    Line 95:
    Here we are creating a new coin object using the input object ‘options’. Here assert statements are checking if coin objects are having correct values for each property.
    Rohan-Dah authored May 6, 2023
    Configuration menu
    Copy the full SHA
    d364ec1 View commit details
    Browse the repository at this point in the history