Skip to content

Instantly share code, notes, and snippets.

View Amrt1n3zm's full-sized avatar
🚛
I may be slow to respond.

Alejandro Amrt1n3zm

🚛
I may be slow to respond.
View GitHub Profile
@Amrt1n3zm
Amrt1n3zm / Assignment1.md
Created April 6, 2022 02:45 — forked from debanshu/Assignment1.md
Assignment1 Cryptocurrency explanation by Felipe

Reproduced as is from Felipe Faria's post

The first thing you must do before starting the assignment is understanding the assignment. For obvious reasons I can't type here a "step-by-step procedure" of the assignment, but I can go over the classes and maybe clarify the instructions a bit better for you and anyone else having difficulties.

Your job for this assignment is to write the TxHandler class, which stands for Transactions Handler. This class has three functions in which you must write it yourself; TxHandler, isValidTx, and handleTxs. As the names suggest, one will initiate the class, one will verify the transactions, and the other will handle the transactions. Now I'm going to assume you have a basic understanding of Java, and you comprehend the idea of classes and functions.

These are the files given to us for the assignment:

Crypt
@Amrt1n3zm
Amrt1n3zm / txhandler.java
Created July 30, 2017 00:52 — forked from yangchenyun/txhandler.java
assignment1 snippet
/**
* Handles each epoch by receiving an unordered array of proposed transactions, checking each
* transaction for correctness, returning a mutually valid array of accepted transactions, and
* updating the current UTXO pool as appropriate.
*/
public Transaction[] handleTxs(Transaction[] possibleTxs) {
// The side effect is to advance the state of the pool.
// Convert the unordered list into a graph, and perform topological sort
/** Mapping from hash to corresponding transaction. */