Skip to content

Commit

Permalink
feedback from xi
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist committed Jun 27, 2024
1 parent 21796e7 commit d57f50e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/contracts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ jobs:
run: cargo install mdbook-pagetoc
- name: Build docs
working-directory: contracts
run: pnpm doc
run: pnpm doc
Empty file removed clients/Makefile
Empty file.
4 changes: 4 additions & 0 deletions clients/js/scripts/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const ALLOW_UNENCRYPTED_DEPLOYS = true;
const UPSTREAM_URL = 'http://127.0.0.1:8545';
const SHOW_ENCRYPTED_RESULTS = false;
const SHOW_ENCRYPTED_REQUESTS = false;

// These are the first 4 'test' accounts
// It's assumed that all tests from these addresses require transaction encryption
// This is to verify that the client encryption wrapper is working correctly.
const DISALLOW_UNENCRYPTED_ONLY_FROM = [
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
'0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
Expand Down
5 changes: 4 additions & 1 deletion clients/js/src/calldatapublickey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ export async function fetchRuntimePublicKeyByChainId(
throw new Error('No fetch implementation found!');
}
const res = await fetchRuntimePublicKeyFromURL(defaultGateway, fetchImpl);
if( ! res.result ) {
throw new Error(`fetchRuntimePublicKeyByChainId failed, empty result in: ${JSON.stringify(res)}`);
}
return toCallDataPublicKey(res.result, chainId);
}

Expand Down Expand Up @@ -170,7 +173,7 @@ export class KeyFetcher {
* Retrieve cached key if possible, otherwise fetch a fresh one
*
* @param upstream Upstream ETH JSON-RPC provider
* @returns calldata public key`
* @returns calldata public key
*/
public async fetch(
upstream: EIP2696_EthereumProvider,
Expand Down
2 changes: 1 addition & 1 deletion examples/hardhat-viem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"hardhat": "~2.22.2",
"viem": "~2.9.19"
}
}
}
2 changes: 1 addition & 1 deletion examples/hardhat-viem/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"test/*.ts",
"ignition/modules/*.ts"
]
}
}
2 changes: 1 addition & 1 deletion integrations/ethers-v6/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist
coverage
coverage
3 changes: 2 additions & 1 deletion integrations/ethers-v6/test/etherstests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,14 @@ async function verifyTransactionEncryption(contract: Contract) {
describe("Ethers v6 + Sapphire", () => {
let wallet1: Wallet;
let contract: Contract;
let rawProvider1: JsonRpcProvider;

before(async function () {
this.timeout(10000);

wallet1 = new Wallet(WELL_KNOWN_WALLET_PRIVATE_KEY);

const rawProvider1 = new JsonRpcProvider(NETWORKS.localnet.defaultGateway);
rawProvider1 = new JsonRpcProvider(NETWORKS.localnet.defaultGateway);
const provider1 = wrapEthersProvider(rawProvider1);

const cw1 = wallet1.connect(provider1);
Expand Down
6 changes: 3 additions & 3 deletions integrations/hardhat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ build lint format test::
$(NPM) $@

clean:
rm -rf dist artifacts cache typechain-types
rm -rf dist artifacts cache typechain-types ignition/deployments

distclean:
rm -rf node_modules *.tgz ignition/deployments
distclean: clean
rm -rf node_modules *.tgz

dependencies:
$(MAKE) -C ../../clients/js full
Expand Down

0 comments on commit d57f50e

Please sign in to comment.