on master help sign in
Merge pull request #138 from urbit/keyfile-fix
883c00bFang
package-lock.json+17−36
@@ -1994,47 +1994,28 @@
1994 }
1994 }
1995 },
1995 },
1996 "azimuth-js": {
1996 "azimuth-js": {
1997− "version": "0.10.0",
1997+ "version": "0.13.2",
1998− "resolved": "https://registry.npmjs.org/azimuth-js/-/azimuth-js-0.10.0.tgz",
1998+ "resolved": "https://registry.npmjs.org/azimuth-js/-/azimuth-js-0.13.2.tgz",
1999− "integrity": "sha512-VDg60BYSpTjsv1K/DX7VY5F0HbxHV0X1cSoG3c1iZYH5Lxy8TErYq4CJ+D6er0xtI7JI3hmKOZS+p+ru42sT3A==",
1999+ "integrity": "sha512-DiteSHZTqst5Ikf5yoOetnU7MIE/El5JIuO9FjyaQHWPYA8ECB4XUaZJCl4VfScnAzzP1YCnORXz/mtVn2D9ng==",
2000 "requires": {
2000 "requires": {
2001− "azimuth-solidity": "1.0.2",
2001+ "azimuth-solidity": "1.1.0",
2002− "ethereumjs-util": "^5.2.0",
2002+ "ethereumjs-util": "^5.2.0"
2003− "web3": "1.0.0-beta.33"
2004 },
2003 },
2005 "dependencies": {
2004 "dependencies": {
2006− "bn.js": {
2005+ "azimuth-solidity": {
2007− "version": "4.11.6",
2008− "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
2009− "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
2010− },
2011− "web3": {
2012− "version": "1.0.0-beta.33",
2006+ "version": "1.1.0",
2013− "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.33.tgz",
2007+ "resolved": "https://registry.npmjs.org/azimuth-solidity/-/azimuth-solidity-1.1.0.tgz",
2014− "integrity": "sha1-xgIbV2mSdyY3HBhLhoRFMRsTkpU=",
2008+ "integrity": "sha512-YhVWKql1ZZ9Zae96nYA7QLwQlTzGspkNOErq170sl/UJwncQbvAyibSv+heMaS18n4soPDiRSpa1vHFoGoIX1A==",
2015− "requires": {
2009+ "requires": {
2016− "web3-bzz": "1.0.0-beta.33",
2010+ "babel-polyfill": "^6.26.0",
2017− "web3-core": "1.0.0-beta.33",
2011+ "babel-register": "^6.26.0",
2018− "web3-eth": "1.0.0-beta.33",
2012+ "openzeppelin-solidity": "1.12.0",
2019− "web3-eth-personal": "1.0.0-beta.33",
2013+ "truffle": "4.1.11"
2020− "web3-net": "1.0.0-beta.33",
2021− "web3-shh": "1.0.0-beta.33",
2022− "web3-utils": "1.0.0-beta.33"
2023 },
2014 },
2024 "dependencies": {
2015 "dependencies": {
2025− "web3-utils": {
2016+ "openzeppelin-solidity": {
2026− "version": "1.0.0-beta.33",
2017+ "version": "1.12.0",
2027− "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.33.tgz",
2018+ "bundled": true
2028− "integrity": "sha1-4JG3mU8JtxSwGYpAV9OtLrjL4jg=",
2029− "requires": {
2030− "bn.js": "4.11.6",
2031− "eth-lib": "0.1.27",
2032− "ethjs-unit": "0.1.6",
2033− "number-to-bn": "1.7.0",
2034− "randomhex": "0.1.5",
2035− "underscore": "1.8.3",
2036− "utf8": "2.1.1"
2037− }
2038 }
2019 }
2039 }
2020 }
2040 }
2021 }
package.json+1−1
@@ -17,7 +17,7 @@
17 "@ledgerhq/hw-app-eth": "^4.35.0",
17 "@ledgerhq/hw-app-eth": "^4.35.0",
18 "@ledgerhq/hw-transport-u2f": "^4.35.0",
18 "@ledgerhq/hw-transport-u2f": "^4.35.0",
19 "PaperCollateralRenderer": "github:urbit/PaperCollateralRenderer",
19 "PaperCollateralRenderer": "github:urbit/PaperCollateralRenderer",
20− "azimuth-js": "^0.10.0",
20+ "azimuth-js": "^0.13.2",
21 "azimuth-solidity": "1.0.2",
21 "azimuth-solidity": "1.0.2",
22 "babel-polyfill": "^6.26.0",
22 "babel-polyfill": "^6.26.0",
23 "bip32": "^1.0.2",
23 "bip32": "^1.0.2",
src/bridge/Bridge.js+5−2
@@ -190,9 +190,10 @@ class Bridge extends React.Component {
190 }
190 }
191 }
191 }
192
192
193− setNetworkSeedCache(networkSeed) {
193+ setNetworkSeedCache(networkSeed, revision) {
194 this.setState({
194 this.setState({
195− networkSeedCache: networkSeed
195+ networkSeedCache: networkSeed,
196+ networkRevisionCache: revision
196 })
197 })
197 }
198 }
198
199
@@ -263,6 +264,7 @@ class Bridge extends React.Component {
263 urbitWallet,
264 urbitWallet,
264 authMnemonic,
265 authMnemonic,
265 networkSeedCache,
266 networkSeedCache,
267+ networkRevisionCache,
266 pointCursor,
268 pointCursor,
267 pointCache,
269 pointCache,
268 txnHashCursor,
270 txnHashCursor,
@@ -316,6 +318,7 @@ class Bridge extends React.Component {
316 pointCursor={ pointCursor }
318 pointCursor={ pointCursor }
317 pointCache={ pointCache }
319 pointCache={ pointCache }
318 networkSeedCache= { networkSeedCache }
320 networkSeedCache= { networkSeedCache }
321+ networkRevisionCache={ networkRevisionCache }
319 setNetworkSeedCache= { this.setNetworkSeedCache }
322 setNetworkSeedCache= { this.setNetworkSeedCache }
320 // txn
323 // txn
321 setTxnHashCursor={ this.setTxnHashCursor }
324 setTxnHashCursor={ this.setTxnHashCursor }
src/bridge/components/StatelessTransaction.js+3−2
@@ -93,8 +93,9 @@ class StatelessTransaction extends React.Component {
93 props.setTxnHashCursor(sent)
93 props.setTxnHashCursor(sent)
94 props.popRoute()
94 props.popRoute()
95
95
96+ //TODO this special logic should live in a handler in SetKeys.
96− if (props.networkSeed) {
97+ if (props.networkSeed && props.newRevision) {
97− props.setNetworkSeedCache(props.networkSeed)
98+ props.setNetworkSeedCache(props.networkSeed, props.newRevision)
98 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
99 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
99 } else {
100 } else {
100 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
101 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
src/bridge/views/GenKeyfile.js+4−1
@@ -40,7 +40,10 @@ class GenKeyfile extends React.Component {
40 ? pointCache[point]
40 ? pointCache[point]
41 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
41 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
42
42
43+ // in case we did SetKeys earlier this session, make sure to generate the
44+ // newer keyfile, rather than the one that will expire soon
45+ const revision = (this.props.networkRevisionCache ||
43− const revision = parseInt(pointDetails.keyRevisionNumber)
46+ parseInt(pointDetails.keyRevisionNumber));
44
47
45 return {
48 return {
46 point,
49 point,
src/bridge/views/SetKeys.js+1
@@ -210,6 +210,7 @@ class SetKeys extends React.Component {
210 canGenerate={ canGenerate }
210 canGenerate={ canGenerate }
211 createUnsignedTxn={this.createUnsignedTxn}
211 createUnsignedTxn={this.createUnsignedTxn}
212 networkSeed={ state.networkSeed }
212 networkSeed={ state.networkSeed }
213+ newRevision={ (parseInt(pointDetails.keyRevisionNumber) + 1) }
213 setNetworkSeedCache={ props.setNetworkSeedCache } />
214 setNetworkSeedCache={ props.setNetworkSeedCache } />
214
215
215 </Col>
216 </Col>