Skip to content

Commit

Permalink
Adds volta ens registry to config.js
Browse files Browse the repository at this point in the history
Updates CHANGELOG.md
Updates tests
  • Loading branch information
Agupane committed Nov 11, 2020
1 parent f3a8352 commit 25dcdf9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Released with 1.0.0-beta.37 code base.

- Add `web3-eth2-core` package (#3743)
- Add `web3-eth2-beaconchain` package (#3743)
- Energy Webchain network ENS registry added to the known registries (#3768)
- Energy WebChain/Volta network ENS registry added to the known registries (#3768)

### Changed

Expand Down
3 changes: 2 additions & 1 deletion packages/web3-eth-ens/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/**
* Source: https://docs.ens.domains/ens-deployments
* EnergyWebChain source: https://energyweb.atlassian.net/wiki/spaces/EWF/pages/555745281/Using+ENS
* EnergyWebChain/Volta source: https://energyweb.atlassian.net/wiki/spaces/EWF/pages/555745281/Using+ENS
*
* @type {{addresses: {main: string, rinkeby: string, goerli: string, ropsten: string}}}
*/
Expand All @@ -33,6 +33,7 @@ var config = {
rinkeby: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
goerli: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
energyWebChain: "0x0A6d64413c07E10E890220BBE1c49170080C6Ca0",
volta: "0xd7CeF70Ba7efc2035256d828d5287e2D285CD1ac",
},
// These ids obtained at ensdomains docs:
// https://docs.ens.domains/contract-developer-guide/writing-a-resolver
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-eth/src/getNetworkType.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ var getNetworkType = function (callback) {
id === 246) {
returnValue = 'energyWebChain';
}
if (genesis.hash === '0xebd8b413ca7b7f84a8dd20d17519ce2b01954c74d94a0a739a3e416abe0e43e5' &&
id === 73799) {
returnValue = 'volta';
}

if (_.isFunction(callback)) {
callback(null, returnValue);
Expand Down
7 changes: 5 additions & 2 deletions test/eth.net.getNetworkType.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ var tests = [{
hash: '0x0b6d3e680af2fc525392c720666cce58e3d8e6fe75ba4b48cb36bcc69039229b',
id: 246,
result: 'energyWebChain'
},{
hash: '0xebd8b413ca7b7f84a8dd20d17519ce2b01954c74d94a0a739a3e416abe0e43e5',
id: 73799,
result: 'volta'
},{
hash: '0xffe56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3',
id: 1,
Expand Down Expand Up @@ -70,8 +74,7 @@ describe('getNetworkType', function () {
done();
})
.catch(function (err) {
throw err;
done();
done(err);
});
});
});
Expand Down

0 comments on commit 25dcdf9

Please sign in to comment.