Skip to content

format code/code refactor #18

@ayrat555

Description

@ayrat555

format code with elixir code formatter and refactor if necessary

For example,

    # The following checks Holistic Validity, as defined in Eq.(29)
    errors = []
      ++ if child_block.header.state_root == block.header.state_root, do: [], else: [:state_root_mismatch]
      ++ if child_block.header.ommers_hash == block.header.ommers_hash, do: [], else: [:ommers_hash_mismatch]
      ++ if child_block.header.transactions_root == block.header.transactions_root, do: [], else: [:transactions_root_mismatch]
      ++ if child_block.header.receipts_root == block.header.receipts_root, do: [], else: [:receipts_root_mismatch]

turns into

    # The following checks Holistic Validity, as defined in Eq.(29)
    errors =
      [] ++
        if child_block.header.state_root == block.header.state_root,
          do: [],
          else:
            [:state_root_mismatch] ++
              if(
                child_block.header.ommers_hash == block.header.ommers_hash,
                do: [],
                else:
                  [:ommers_hash_mismatch] ++
                    if(
                      child_block.header.transactions_root == block.header.transactions_root,
                      do: [],
                      else:
                        [:transactions_root_mismatch] ++
                          if(
                            child_block.header.receipts_root == block.header.receipts_root,
                            do: [],
                            else: [:receipts_root_mismatch]
                          )
                    )
              )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions