From c2d965649eed4e34c03848755b00ab4be7165eee Mon Sep 17 00:00:00 2001 From: cehali Date: Thu, 14 Sep 2023 15:37:00 +0200 Subject: [PATCH] Fix issue with wrong function name in tutorial text --- .../TUTORIAL.md | 7 +------ .../code/src/core/blockchain.ts | 4 ++-- .../code/test/stable-marketplace.test.ts | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/TUTORIAL.md b/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/TUTORIAL.md index 0d60a14..4c0083a 100644 --- a/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/TUTORIAL.md +++ b/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/TUTORIAL.md @@ -157,11 +157,6 @@ The second thing to do is adjust the Typescript code of the dApp. Please take a ```js import { WrapperBuilder } from "@redstone-finance/evm-connector"; -async function getContractInstance(contractName) { - ... - return new ethers.Contract(address, abi, signer); -} - async function buy(orderId: string) { const marketplace = await getContractInstance("marketplace"); @@ -183,7 +178,7 @@ async function buy(orderId: string) { const expectedEthAmount = await wrappedMarketplaceContract.getPrice(orderId); // Sending buy tx - const buyTx = await wrappedMarketplaceContract.wi(orderId, { + const buyTx = await wrappedMarketplaceContract.buy(orderId, { value: expectedEthAmount.mul(101).div(100), // a buffer for price movements }); await buyTx.wait(); diff --git a/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/src/core/blockchain.ts b/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/src/core/blockchain.ts index 2484dd4..9fae4ab 100644 --- a/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/src/core/blockchain.ts +++ b/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/src/core/blockchain.ts @@ -1,6 +1,6 @@ import { Web3Provider, Contract } from "zksync-web3"; -import { WrapperBuilder } from "@redstone-finance/evm-connector"; -import { ethers, utils } from "ethers"; +// import { WrapperBuilder } from "@redstone-finance/evm-connector"; +import { utils } from "ethers"; import localAddresses from "../config/zkSyncTestnet-addresses.json"; import nftAbi from "../config/nft-abi.json"; import marketplaceAbi from "../config/marketplace-abi.json"; diff --git a/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/test/stable-marketplace.test.ts b/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/test/stable-marketplace.test.ts index dd87f48..320c391 100644 --- a/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/test/stable-marketplace.test.ts +++ b/tutorials/zkSync-RedStone-stable-price-marketplace-tutorial/code/test/stable-marketplace.test.ts @@ -85,7 +85,7 @@ describe("Stable marketplace core functions test", function () { const orderId = 0; // Get expected ETH amount - const expectedEthAmount = await stableMarketplaceContract.getPrice( + const expectedEthAmount = await wrappedMarketplaceContract.getPrice( orderId ); logExpectedAmount(expectedEthAmount);