Merge pull request #333 from conr2d/eosio-support

Add support EOSIO
This commit is contained in:
iancoleman
2019-06-11 09:39:00 +10:00
committed by GitHub
4 changed files with 7451 additions and 5 deletions

View File

@@ -928,6 +928,7 @@
<script src="js/ripple-util.js"></script>
<script src="js/bchaddrjs-0.2.1.js"></script>
<script src="js/nebulas-account.js"></script>
<script src="js/eos-util.js"></script>
<script src="js/sjcl-bip39.js"></script>
<script src="js/wordlist_english.js"></script>
<script src="js/wordlist_japanese.js"></script>

7414
src/js/eos-util.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -985,6 +985,12 @@
address = bitcoinjs.bitcoin.networks.crown.toNewAddress(address);
}
if (networks[DOM.network.val()].name == "EOS - EOSIO") {
address = ""
pubkey = eosUtil.bufferToPublic(keyPair.getPublicKeyBuffer());
privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32));
}
addAddressToList(indexText, address, pubkey, privkey);
if (isLast) {
hidePending();
@@ -2016,6 +2022,13 @@
setHdCoin(151);
},
},
{
name: "EOS - EOSIO",
onSelect: function() {
network = bitcoinjs.bitcoin.networks.bitcoin;
setHdCoin(194);
},
},
{
name: "ESN - Ethersocial Network",
segwitAvailable: false,

View File

@@ -73,16 +73,23 @@ else if (browser == "chrome") {
// Helper functions
function testNetwork(done, params) {
function testNetwork(done, params, comparePub = false) {
var phrase = params.phrase || 'abandon abandon ability';
driver.findElement(By.css('.phrase'))
.sendKeys(phrase);
selectNetwork(params.selectText);
driver.sleep(generateDelay).then(function() {
getFirstAddress(function(address) {
expect(address).toBe(params.firstAddress);
done();
});
if (!comparePub) {
getFirstAddress(function(address) {
expect(address).toBe(params.firstAddress);
done();
});
} else {
getFirstPublicKey(function(pubkey) {
expect(pubkey).toBe(params.firstPubKey);
done();
});
}
});
}
@@ -98,6 +105,10 @@ function getFirstAddress(handler) {
getFirstRowValue(handler, ".address");
}
function getFirstPublicKey(handler) {
getFirstRowValue(handler, ".pubkey");
}
function getFirstPath(handler) {
getFirstRowValue(handler, ".index");
}
@@ -867,6 +878,13 @@ it('Allows selection of Einsteinium', function(done) {
};
testNetwork(done, params);
});
it('Allows selection of EOSIO', function(done) {
var params = {
selectText: "EOS - EOSIO",
firstPubKey: "EOS692VJTBK3Rmw93onNnpnZ8ZtmE9PdxjDStArvbyzoe11QUTNoy",
};
testNetowrk(done, params, true);
});
it('Allows selection of Europecoin', function(done) {
var params = {
selectText: "ERC - Europecoin",