Skip to content

Commit

Permalink
Refer to contract .address, not ._address
Browse files Browse the repository at this point in the history
This makes us compatible with contract object from the latest web3
version.
  • Loading branch information
Fang- committed Apr 16, 2019
1 parent 67d5a3d commit d53bf4c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions internal/conditionalSR.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,42 @@ const tx = (to, data, value) => ({
});

module.exports.approveCommitmentTransfer = (contracts, _to) => {
let addr = contracts.conditionalSR._address;
let addr = contracts.conditionalSR.address;
let data = contracts.conditionalSR.methods.approveCommitmentTransfer(_to);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.transferCommitment = (contracts, _from) => {
let addr = contracts.conditionalSR._address;
let addr = contracts.conditionalSR.address;
let data = contracts.conditionalSR.methods.transferCommitment(_from);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.withdraw = (contracts) => {
let addr = contracts.conditionalSR._address;
let addr = contracts.conditionalSR.address;
let data = contracts.conditionalSR.methods.withdraw();
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.withdrawTo = (contracts, _to) => {
let addr = contracts.conditionalSR._address;
let addr = contracts.conditionalSR.address;
let data = contracts.conditionalSR.methods.withdrawTo(_to);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.forfeit = (contracts, _batch) => {
let addr = contracts.conditionalSR._address;
let addr = contracts.conditionalSR.address;
let data = contracts.conditionalSR.methods.forfeit(_batch);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.analyzeCondition = (contracts, _condition) => {
let addr = contracts.conditionalSR._address;
let addr = contracts.conditionalSR.address;
let data = contracts.conditionalSR.methods.analyzeCondition(_condition);
let abi = data.encodeABI();
return tx(addr, abi, 0);
Expand Down
50 changes: 25 additions & 25 deletions internal/ecliptic.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports.canEscapeTo = (contracts, point, sponsor) => {
// function pointers/variadic arguments, e.g. something like:
//
// function txFromMethod(method, ...args) {
// let addr = contracts.ecliptic._address;
// let addr = contracts.ecliptic.address;
// let data = contracts.ecliptic.methods.method.apply(this, args);
// let abi = data.encodeABI();
// return tx(addr, abi, 0);
Expand All @@ -53,37 +53,37 @@ const tx = (to, data, value) => ({
});

module.exports.safeTransferFrom = (contracts, _from, _to, _point) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.safeTransferFrom(
_from, _to, _point);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.transferFrom = (contracts, _from, _to, _point) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.transferFrom(_from, _to, _point);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.approve = (contracts, _approved, _point) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.approve(_approved, _point);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.setApprovalForAll = (contracts, _operator, _approved) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.setApprovalForAll(
_operator, _approved);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.setManagementProxy = (contracts, _point, _manager) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.setManagementProxy(_point, _manager);
let abi = data.encodeABI();
return tx(addr, abi, 0);
Expand All @@ -93,7 +93,7 @@ module.exports.configureKeys =
(contracts, _point,
_encryptionKey, _authenticationKey,
_cryptoSuiteVersion, _discontinuous) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.configureKeys(
_point, _encryptionKey, _authenticationKey,
_cryptoSuiteVersion, _discontinuous);
Expand All @@ -102,88 +102,88 @@ module.exports.configureKeys =
}

module.exports.spawn = (contracts, _point, _target) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.spawn(_point, _target);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.setSpawnProxy = (contracts, _prefix, _spawnProxy) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.setSpawnProxy(
_prefix, _spawnProxy);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.transferPoint = (contracts, _point, _target, _reset) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.transferPoint(
_point, _target, _reset);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.setTransferProxy = (contracts, _point, _transferProxy) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.setTransferProxy(
_point, _transferProxy);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.escape = (contracts, _point, _sponsor) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.escape(_point, _sponsor);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.cancelEscape = (contracts, _point) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.cancelEscape(_point);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.adopt = (contracts, _escapee) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.adopt(_escapee);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.reject = (contracts, _escapee) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.reject(_escapee);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.detach = (contracts, _point) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.detach(_point);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.setVotingProxy = (contracts, _galaxy, _proxy) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.setVotingProxy(_galaxy, _proxy);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.startUpgradePoll = (contracts, _galaxy, _proposal) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.startUpgradePoll(
_galaxy, _proposal);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.startDocumentPoll = (contracts, _galaxy, _proposal) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.startDocumentPoll(
_galaxy, _proposal);
let abi = data.encodeABI();
Expand All @@ -192,45 +192,45 @@ module.exports.startDocumentPoll = (contracts, _galaxy, _proposal) => {

module.exports.castUpgradeVote =
(contracts, _galaxy, _proposal, _vote) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.castUpgradeVote(
_galaxy, _proposal, _vote);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.castDocumentVote = (contracts, _galaxy, _proposal, _vote) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.castDocumentVote(
_galaxy, _proposal, _vote);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.updateUpgradePoll = (contracts, _proposal) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.updateUpgradePoll(_proposal);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.updateDocumentPoll = (contracts, _proposal) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.updateDocumentPoll(_proposal);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.createGalaxy = (contracts, _galaxy, _target) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.createGalaxy(_galaxy, _target);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.setDnsDomains =
(contracts, _primary, _secondary, _tertiary) => {
let addr = contracts.ecliptic._address;
let addr = contracts.ecliptic.address;
let data = contracts.ecliptic.methods.setDnsDomains(
_primary, _secondary, _tertiary);
let abi = data.encodeABI();
Expand Down
8 changes: 4 additions & 4 deletions internal/linearSR.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ const tx = (to, data, value) => ({
});

module.exports.approveBatchTransfer = (contracts, _to) => {
let addr = contracts.linearSR._address;
let addr = contracts.linearSR.address;
let data = contracts.linearSR.methods.approveBatchTransfer(_to);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.transferBatch = (contracts, _from) => {
let addr = contracts.linearSR._address;
let addr = contracts.linearSR.address;
let data = contracts.linearSR.methods.transferBatch(_from);
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.withdraw = (contracts) => {
let addr = contracts.linearSR._address;
let addr = contracts.linearSR.address;
let data = contracts.linearSR.methods.withdraw();
let abi = data.encodeABI();
return tx(addr, abi, 0);
}

module.exports.withdrawTo = (contracts, _to) => {
let addr = contracts.linearSR._address;
let addr = contracts.linearSR.address;
let data = contracts.linearSR.methods.withdrawTo(_to);
let abi = data.encodeABI();
return tx(addr, abi, 0);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"azimuth-solidity": "1.0.2",
"ethereumjs-util": "^5.2.0",
"web3": "1.0.0-beta.33"
"web3": "1.0.0-beta.52"
},
"author": "Tlon",
"license": "MIT",
Expand Down

0 comments on commit d53bf4c

Please sign in to comment.