mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-15 06:52:16 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23f393acfb | ||
|
|
c560e01e91 | ||
|
|
a362ff2f62 | ||
|
|
9a82f12b91 |
@@ -1,3 +1,7 @@
|
||||
# 0.5.2
|
||||
|
||||
* Show ethereum private keys with correct padding
|
||||
|
||||
# 0.5.1
|
||||
|
||||
* Add Portuguese language
|
||||
|
||||
@@ -45,10 +45,10 @@ cd tests
|
||||
npm install --global jasmine
|
||||
npm install selenium-webdriver
|
||||
# install gecko webdriver for firefox
|
||||
wget https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz
|
||||
wget https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz
|
||||
tar -xf /tmp/geckodriver.tar.gz -C $HOME/.bin
|
||||
# install chrome webdriver for chromium
|
||||
wget https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
|
||||
wget https://chromedriver.storage.googleapis.com/88.0.4324.96/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
|
||||
unzip /tmp/chromedriver.zip -d $HOME/.bin
|
||||
|
||||
# to run tests
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.5.1</p>
|
||||
<p class="version">v0.5.2</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -1238,7 +1238,7 @@
|
||||
address = libs.ethUtil.addHexPrefix(checksumAddress);
|
||||
pubkey = libs.ethUtil.addHexPrefix(pubkey);
|
||||
if (hasPrivkey) {
|
||||
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer());
|
||||
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer(32));
|
||||
}
|
||||
}
|
||||
//TRX is different
|
||||
|
||||
@@ -5122,4 +5122,26 @@ it('Generates ethereum addresses from a public key', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
// https://github.com/iancoleman/bip39/issues/469
|
||||
it('Generates ethereum private keys with the correct padding', function(done) {
|
||||
var phrase = "flip vicious divorce angle toward say derive blue refuse load word creek once expire bounce";
|
||||
let withoutPadding = "0x53121fc5d193e623d2dbf43b2a96640bbed16bd530947fff8dda12f1aec828";
|
||||
let withPadding = "0x0053121fc5d193e623d2dbf43b2a96640bbed16bd530947fff8dda12f1aec828";
|
||||
let skIndex = 15;
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys(phrase);
|
||||
selectNetwork('ETH - Ethereum');
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
driver.findElements(By.css(".privkey"))
|
||||
.then(function(els) {
|
||||
els[skIndex].getText()
|
||||
.then(function(sk) {
|
||||
expect(sk).toBe(withPadding);
|
||||
expect(sk).not.toBe(withoutPadding);
|
||||
done();
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user