Skip to content

Commit

Permalink
examples/onchain-signer: Add encryptCallData()
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Dec 23, 2024
1 parent 8f279e2 commit 1222cb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/onchain-signer/contracts/Gasless.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {encryptCallData} from "@oasisprotocol/sapphire-contracts/contracts/CalldataEncryption.sol";
import {EIP155Signer} from "@oasisprotocol/sapphire-contracts/contracts/EIP155Signer.sol";

struct EthereumKeypair {
Expand All @@ -26,7 +27,6 @@ contract Gasless {
) external view returns (bytes memory output) {
bytes memory data = abi.encode(innercallAddr, innercall);

// Call will invoke proxy().
return
EIP155Signer.sign(
kp.addr,
Expand All @@ -37,7 +37,7 @@ contract Gasless {
gasLimit: 250000,
to: address(this),
value: 0,
data: abi.encodeCall(this.proxy, data),
data: encryptCallData(abi.encodeCall(this.proxy, data)),
chainId: block.chainid
})
);
Expand Down
2 changes: 1 addition & 1 deletion examples/onchain-signer/test/CommentBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('CommentBox', function () {
const provider = ethers.provider;

// You can set up sapphire-localnet image and run the test like this:
// docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet -to 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
// docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet
// npx hardhat test --grep proxy --network sapphire-localnet
const chainId = (await provider.getNetwork()).chainId;
if (chainId == BigInt(1337)) {
Expand Down

0 comments on commit 1222cb2

Please sign in to comment.