Skip to content

Commit

Permalink
Merge pull request #2 from aquiladev/swarm-ens
Browse files Browse the repository at this point in the history
fix dryrun for CNS
  • Loading branch information
aquiladev authored Mar 28, 2020
2 parents dbacdcc + d4911cc commit fea22e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion updater/cns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const registry = '0xD1E5b0FF1287aA9f9A268759062E4Ab08b9Dacbe';
const ipfsKey = 'ipfs.html.value';

function CNS(options) {
const { mnemonic, rpc, name, verbose } = options;
const { mnemonic, rpc, name, dryrun, verbose } = options;

const provider = new HDWalletProvider(mnemonic, rpc);
const web3 = new Web3(provider);
Expand Down Expand Up @@ -54,6 +54,10 @@ function CNS(options) {
const tokenId = namehash(name);
const resolverContract = await getResolverContract(tokenId);

if (dryrun) {
return;
}

return resolverContract.methods.set(ipfsKey, contentHash, tokenId)
.send({ from: provider.addresses[0] });
}
Expand Down

0 comments on commit fea22e0

Please sign in to comment.