From 20f19a0f503da04bfa27dcf81286d239c863c847 Mon Sep 17 00:00:00 2001 From: ttheolier Date: Mon, 14 Feb 2022 10:25:37 -0800 Subject: [PATCH] private methods --- src/mainRegistry.js | 8 ++++---- tT.js | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mainRegistry.js b/src/mainRegistry.js index b4be09d..94271f3 100644 --- a/src/mainRegistry.js +++ b/src/mainRegistry.js @@ -63,7 +63,7 @@ const createConnectorRegistry = (_credentials, _secret) => { return response.data } - getEncryptedAPIKey = async (_moat) => { + #getEncryptedAPIKey = async (_moat) => { let _params = JSON.parse(JSON.stringify(params)) //we must copy the params since we will be writing to them //Putting a warning here, honestly for my sake more than anything else @@ -75,7 +75,7 @@ const createConnectorRegistry = (_credentials, _secret) => { return response.data } - updateSecretInternal = async (_moat,_signature,_newSecret,_owner,_store=false) => { + #updateSecretInternal = async (_moat,_signature,_newSecret,_owner,_store=false) => { let _params = JSON.parse(JSON.stringify(params)) //we must copy the params since we will be writing to them //Putting a warning here, honestly for my sake more than anything else @@ -95,7 +95,7 @@ const createConnectorRegistry = (_credentials, _secret) => { //Putting a warning here, honestly for my sake more than anything else - const encrypt = await this.getEncryptedAPIKey(_moat); + const encrypt = await this.#getEncryptedAPIKey(_moat); console.log(encrypt[0].api_key); await window.ethereum.send('eth_requestAccounts'); const provider = new ethers.providers.Web3Provider(window.ethereum); @@ -108,7 +108,7 @@ const createConnectorRegistry = (_credentials, _secret) => { const address = await signer.getAddress(); console.log(signature) console.log(address) - await this.updateSecretInternal(_moat,signature,_newSecret,address); + await this.#updateSecretInternal(_moat,signature,_newSecret,address); /*const response = await axios(_params) console.log(response.data)*/ //return response.data diff --git a/tT.js b/tT.js index eb42f3f..cac3e8b 100644 --- a/tT.js +++ b/tT.js @@ -33,12 +33,13 @@ const testF = async () => { //kwilDB.query(`CREATE TABLE testtabl2(test_col text)`, true) //await kwilDB.storeJPEG('images/img.jpg',b64String,false); //await kwilDB.storeFile('text/txt.txt',b64String.string,false); - //await kwilDB.addMoat('testmoat','random owner address','randomapikey','superencryptedsecret'); + //await kwilDB2.addMoat('testmoat1','random owner address','randomapikey','superencryptedsecret'); //await kwilDB.addSecret('testmoat','secret2',Date.now()); - //console.log(await kwilDB.getMoats('random owner address')); - //console.log(await kwilDB2.getEncryptedAPIKey('testmoat')); - await kwilDB2.updateSecret('testmoat',sig,'newthingy',owner); + //console.log(await kwilDB2.getMoats('random owner address')); + //console.log(await kwilDB2.getSecrets('testmoat')); + console.log(await kwilDB2.getEncryptedAPIKey('testmoat1')); + //await kwilDB2.updateSecret('testmoat',sig,'newthingy',owner); } testF() \ No newline at end of file