Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
private methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ttheolier committed Feb 14, 2022
1 parent 7413085 commit 20f19a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/mainRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions tT.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 20f19a0

Please sign in to comment.