@@ -36953,7 +36953,7 @@ This component handles connecting to the wallet, switching networks if necessary
3695336953To integrate this component to your dApp, you need to overwrite the existing boilerplate in `app/page.js` with the following code:
3695436954
3695536955```javascript title="app/page.js"
36956- Invalid snippet reference: https://raw.githubusercontent.com/polkadot-developers/polkavm-storage-contract-dapps/refs/tags/v0.0.2/ethers-dapp/app/page.js::1
36956+ 'use client';
3695736957import { useState } from 'react';
3695836958
3695936959import WalletConnect from './components/WalletConnect';
@@ -37055,7 +37055,7 @@ This component reads the `storedNumber` value from the contract and displays it
3705537055To see this change in your dApp, you need to integrate this component into the `app/page.js` file:
3705637056
3705737057```javascript title="app/page.js"
37058- Invalid snippet reference: https://raw.githubusercontent.com/polkadot-developers/polkavm-storage-contract-dapps/refs/tags/v0.0.2/ethers-dapp/app/page.js::1
37058+ 'use client';
3705937059import { useState } from 'react';
3706037060
3706137061import WalletConnect from './components/WalletConnect';
@@ -37640,7 +37640,7 @@ This component handles connecting to the wallet, switching networks if necessary
3764037640To use this component in your dApp, replace the existing boilerplate in `app/page.tsx` with the following code:
3764137641
3764237642```typescript title="page.tsx"
37643- Invalid snippet reference: https://raw.githubusercontent.com/polkadot-developers/polkavm-storage-contract-dapps/refs/tags/v0.0.2/viem-dapp/app/page.tsx::1
37643+ "use client";
3764437644import { useState } from "react";
3764537645import WalletConnect from "./components/WalletConnect";
3764637646export default function Home() {
@@ -37747,7 +37747,7 @@ This component reads the `storedNumber` value from the contract and displays it
3774737747To reflect this change in your dApp, incorporate this component into the `app/page.tsx` file.
3774837748
3774937749```typescript title="page.tsx"
37750- Invalid snippet reference: https://raw.githubusercontent.com/polkadot-developers/polkavm-storage-contract-dapps/refs/tags/v0.0.2/viem-dapp/app/page.tsx::1
37750+ "use client";
3775137751import { useState } from "react";
3775237752import WalletConnect from "./components/WalletConnect";
3775337753import ReadContract from "./components/ReadContract";
@@ -38298,7 +38298,25 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
38298382981. Create a folder for testing called `test`. Inside that directory, create a file named `Storage.js` and add the following code:
3829938299
3830038300 ```javascript title="Storage.js"
38301-
38301+ const { expect } = require('chai');
38302+ const { ethers } = require('hardhat');
38303+
38304+ describe('Storage', function () {
38305+ let storage;
38306+ let owner;
38307+ let addr1;
38308+
38309+ beforeEach(async function () {
38310+ // Get signers
38311+ [owner, addr1] = await ethers.getSigners();
38312+
38313+ // Deploy the Storage contract
38314+ const Storage = await ethers.getContractFactory('Storage');
38315+ storage = await Storage.deploy();
38316+ await storage.waitForDeployment();
38317+ });
38318+
38319+ describe('Basic functionality', function () {
3830238320 // Add your logic here
3830338321 });
3830438322});
0 commit comments