-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (30 loc) · 1.17 KB
/
Copy pathProgram.cs
File metadata and controls
31 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
namespace BlockchainTestCase
{
class Program
{
//Errors with timing and first block being empty due to same transaction appearing later in the chain
static void Main(string[] args)
{
Random rd = new Random();
List<int> ids = new List<int>();
ids.Add(rd.Next()); ids.Add(rd.Next()); ids.Add(rd.Next()); ids.Add(rd.Next()); ids.Add(rd.Next()); ids.Add(rd.Next()); ids.Add(rd.Next());
Miner minerA = new Miner();
Miner minerB = new Miner();
List<Miner> miners = new List<Miner>();
miners.Add(minerA); miners.Add(minerB);
User userA = new User(miners,ids);
User userB = new User(miners, ids);
List<User> users = new List<User>();
users.Add(userA); users.Add(userB);
minerA.SetMiners(miners);
minerA.SetUsers(users);
minerB.SetMiners(miners);
minerB.SetUsers(users);
userA.CreateRandomTransaction(userB);
userA.CreateRandomTransaction(userB);
userA.CreateRandomTransaction(userB);
}
}
}