refactor(@embark/deployment): make use of newly introduced ZERO_ADDRESS

This commit is contained in:
Pascal Precht 2018-11-20 11:48:59 +01:00 committed by Pascal Precht
parent 8b68beca17
commit c66fe695f0
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
let async = require('async');
//require("../utils/debug_util.js")(__filename, async);
let utils = require('../../utils/utils.js');
import { ZERO_ADDRESS } from '../../utils/addressUtils';
class ContractDeployer {
constructor(options) {
@ -45,7 +46,7 @@ class ContractDeployer {
self.events.request('contracts:contract', contractName, (referedContract) => {
// Because we're referring to a contract that is not being deployed (ie. an interface),
// we still need to provide a valid address so that the ABI checker won't fail.
cb(null, (referedContract.deployedAddress || '0x0000000000000000000000000000000000000000'));
cb(null, (referedContract.deployedAddress || ZERO_ADDRESS));
});
}

View File

@ -1,6 +1,6 @@
const ZERO_ADDRESS_SHORTHAND_REGEX = /^0x0$/;
const ZERO_ADDRESS_SHORTHAND_SEARCH_REGEX = /'0x0'/g;
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
export function extendZeroAddressShorthand(value: string) {
if (value.match(ZERO_ADDRESS_SHORTHAND_REGEX) !== null) {