-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtokens.pug
More file actions
64 lines (58 loc) · 3.45 KB
/
tokens.pug
File metadata and controls
64 lines (58 loc) · 3.45 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
extends layout
block content
.container-fluid
h1 #{__('Tokens')}
- var peers = {1: 'A', 2: 'B', 3: 'C'}
each peer, chain in peers
h3 #{__('Peer')} #{peer}
.row.row-horizon
- var blocks = []
- blocks.push({block: 1, chain: chain, nonce: 139358, txs: [{value: '25.00', from: 'Darcy', to: 'Bingley'},{value: '4.27', from: 'Elizabeth', to: 'Jane'},{value: '19.22', from: 'Wickham', to: 'Lydia'},{value: '106.44', from: 'Lady Catherine de Bourgh', to: 'Collins'},{value: '6.42', from: 'Charlotte', to: 'Elizabeth'}], previous: '0000000000000000000000000000000000000000000000000000000000000000'})
- blocks.push({block: 2, chain: chain, nonce: 39207, txs: [{value: '97.67', from: 'Ripley', to: 'Lambert'},{value: '48.61', from: 'Kane', to: 'Ash'},{value: '6.15', from: 'Parker', to: 'Dallas'},{value: '10.44', from: 'Hicks', to: 'Newt'},{value: '88.32', from: 'Bishop', to: 'Burke'},{value: '45.00', from: 'Hudson', to: 'Gorman'},{value: '92.00', from: 'Vasquez', to: 'Apone'}], previous: '00000c52990ee86de55ec4b9b32beefd745d71675dc0eddfbc7b88336e2e296b'})
- blocks.push({block: 3, chain: chain, nonce: 13804, txs: [{value: '10.00', from: 'Emily', to: 'Jackson'},{value: '5.00', from: 'Madison', to: 'Jackson'},{value: '20.00', from: 'Lucas', to: 'Grace'}], previous: '000078be183417844c14a9251ca246fb15df1074019873f5d85c1a6f4311d4e0'})
- blocks.push({block: 4, chain: chain, nonce: 20688, txs: [{value: '62.19', from: 'Rick', to: 'Ilsa'},{value: '867.96', from: 'Captain Louis Renault', to: 'Strasser'},{value: '276.15', from: 'Victor Laszlo', to: 'Ilsa'},{value: '97.13', from: 'Rick', to: 'Sam'},{value: '119.63', from: 'Captain Louis Renault', to: 'Jan Brandel'}], previous: '0000c2c95f54a49b4f2bee7056a7dc3b7c1a408706c848b520e20eac75aaceb0'})
- blocks.push({block: 5, chain: chain, nonce: 33083, txs: [{value: '14.12', from: 'Denise Lovett', to: 'Edmund Lovett'},{value: '2,760.29', from: 'Lord Glendenning', to: 'John Moray'},{value: '413.78', from: 'Katherine Glendenning', to: 'Miss Audrey'}], previous: '0000c03019ed59586405750968888fb65256e82492480d9fe0a6bd2f5e86b5ca'})
each block in blocks
.col-xs-7
include includes/tokenblock
script.
$(function() {
setup(1, 1);
setup(2, 1);
setup(3, 1);
setup(4, 1);
setup(5, 1);
setup(1, 2);
setup(2, 2);
setup(3, 2);
setup(4, 2);
setup(5, 2);
setup(1, 3);
setup(2, 3);
setup(3, 3);
setup(4, 3);
setup(5, 3);
});
function getText(block, chain) {
var s = $('#block'+block+'chain'+chain+'number').val() +
$('#block'+block+'chain'+chain+'nonce').val();
for (var x=0; $('#block'+block+'chain'+chain+'tx'+x+'value').length > 0; x++) {
s = s + $('#block'+block+'chain'+chain+'tx'+x+'value').val() +
$('#block'+block+'chain'+chain+'tx'+x+'from').val() +
$('#block'+block+'chain'+chain+'tx'+x+'to').val();
}
s = s + $('#block'+block+'chain'+chain+'previous').val();
return s;
}
function setup(block, chain) {
updateHash(block, chain);
$('#block'+block+'chain'+chain+'mineButton').click(function(e) {
e.preventDefault();
var l = Ladda.create(this);
l.start();
setTimeout(function() {
mine(block, chain, true);
l.stop();
}, 250); // give UI time to update
});
}