Created
June 3, 2018 00:25
-
-
Save JohnnyZhao/9a269bbffa6f1eb9d82e1020b1ebba20 to your computer and use it in GitHub Desktop.
Cross check eos final snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| f = open('snapshot.csv') | |
| dict1 = {} | |
| for line in f.readlines(): | |
| l = line.strip().split(',') | |
| eth_addr, eos_addr, balance = l | |
| eth_addr = eth_addr.lower() | |
| eos_addr = eos_addr.lower() | |
| if dict1.has_key(eth_addr): | |
| print dict1[eth_addr] | |
| print line | |
| break | |
| dict1[eth_addr] = (eos_addr, balance) | |
| f.close() | |
| f = open('snapshot2.csv') | |
| count = 0 | |
| for line in f.readlines(): | |
| l = line.strip().split(',') | |
| eth_addr, account, eos_addr, balance = l | |
| eth_addr = eth_addr.lower() | |
| eos_addr = eos_addr.lower() | |
| if not dict1.has_key(eth_addr): | |
| count += 1 | |
| print count, "line does not exist!", line | |
| elif dict1[eth_addr][0] != eos_addr or dict1[eth_addr][1] != balance: | |
| count += 1 | |
| print count, "invalid line found!", dict1[eth_addr], eos_addr, balance | |
| f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment