Skip to content

Commit

Permalink
refactor: create requirements.txt
Browse files Browse the repository at this point in the history
It is created to tell grader the dependencies we are using in the project
  • Loading branch information
15IITian committed Apr 29, 2024
1 parent 177e2bf commit 4d2a943
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 151 deletions.
5 changes: 1 addition & 4 deletions Block.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get_mined_tx_data(cls, tx_files):
fee_collected = 0
tx_included= []

# we should also account for weight of coinbase tx
for tx in tx_files:
if (BLOCK_SIZE_FOR_TX -weight_stored)> tx["weights"]:
tx_count+= 1
Expand Down Expand Up @@ -112,8 +113,6 @@ def create_block(cls, tx_files):

# get the data related to tx mined in our block
(tx_count,tx_included,fees_collected,weight_stored)=Block.get_mined_tx_data(tx_files)


#-------------------------------------------------------------------------------------------

# create coinbase tx and get serliased form
Expand Down Expand Up @@ -207,5 +206,3 @@ def get_valid_nonce(self,target):
print("shit-man")
break
return self


11 changes: 3 additions & 8 deletions Helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


import json,hashlib,os
from RIPEMD160 import ripemd160
from Crypto.Hash import RIPEMD160


## This function will return all the the transactions
Expand Down Expand Up @@ -168,11 +168,6 @@ def merkle_root(hashes):


def HASH160(s):
return ripemd160(s)
hash_object = RIPEMD160.new(data=s)
return hash_object.digest()







137 changes: 0 additions & 137 deletions RIPEMD160.py

This file was deleted.

Binary file modified __pycache__/Block.cpython-311.pyc
Binary file not shown.
Binary file modified __pycache__/Helper.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0060e92f3f18ee206e1350f1cabe4ff319851d4c3c64b8d2d90e03000000000000000000664d84331a42280c640a257b7e2223c2774445a448668a242a075add51187f57cf282d66ffff001f9c2d0100
0060e92f3f18ee206e1350f1cabe4ff319851d4c3c64b8d2d90e03000000000000000000664d84331a42280c640a257b7e2223c2774445a448668a242a075add51187f57252f2f66ffff001fc8060000
010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff11030cd3bf0c004f4345414e2e58595a002effffffff02e412bf13000000001976a9142c30a6aaac6d96687291475d7d52f4b469f665a688ac0000000000000000266a24aa21a9ed68d3d720d695be2c9d1e2f33c3d9d1042bdec1ce26b563afdc471db6a02a12520120000000000000000000000000000000000000000000000000000000000000000000000000
96cb0dce25d42069df3ad24623a1d0c303e32b30412821f25cb7f6619d2e66c5
dcd522b3588c7adb0418454539e1a929fff936f211e5a20383fdcbc3ad8751b9
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pycryptodome==3.20.0
4 changes: 3 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Update this file to run your own code
#!/bin/bash

# Run main.py and redirect output to Output.txt
# install required dependencies from requirements.txt
pip install -r requirements.txt

# Run main.py and redirect output to Output.txt
python main.py > output.txt

0 comments on commit 4d2a943

Please sign in to comment.