From d4911ccd3effbaf35627863f9aa82514c24934e8 Mon Sep 17 00:00:00 2001 From: Sergii Bomko Date: Sat, 28 Mar 2020 14:33:01 +0200 Subject: [PATCH] fix dryrun for CNS --- updater/cns/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/updater/cns/index.js b/updater/cns/index.js index af68c08e..ce8fc200 100644 --- a/updater/cns/index.js +++ b/updater/cns/index.js @@ -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); @@ -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] }); }