diff --git a/packages/contracts/src/utils/ContractUtils.ts b/packages/contracts/src/utils/ContractUtils.ts index 344f4086..cf6e07b6 100644 --- a/packages/contracts/src/utils/ContractUtils.ts +++ b/packages/contracts/src/utils/ContractUtils.ts @@ -153,10 +153,10 @@ export class ContractUtils { return signer.signMessage(message); } - public static getShopId(name: string, account: string): string { + public static getShopId(account: string): string { const encodedResult = hre.ethers.utils.defaultAbiCoder.encode( - ["string", "address", "bytes32"], - [name, account, crypto.randomBytes(32)] + ["address", "bytes32"], + [account, crypto.randomBytes(32)] ); return hre.ethers.utils.keccak256(encodedResult); } diff --git a/packages/contracts/test/02-ShopCollection.test.ts b/packages/contracts/test/02-ShopCollection.test.ts index ed0502d8..718641a3 100644 --- a/packages/contracts/test/02-ShopCollection.test.ts +++ b/packages/contracts/test/02-ShopCollection.test.ts @@ -93,7 +93,7 @@ describe("Test for ShopCollection", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); @@ -200,7 +200,7 @@ describe("Test for ShopCollection", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); diff --git a/packages/contracts/test/03-Ledger.test.ts b/packages/contracts/test/03-Ledger.test.ts index 353cdda4..6252cc6e 100644 --- a/packages/contracts/test/03-Ledger.test.ts +++ b/packages/contracts/test/03-Ledger.test.ts @@ -20,7 +20,6 @@ import { BigNumber, Wallet } from "ethers"; import * as hre from "hardhat"; import { AddressZero } from "@ethersproject/constants"; -import { waffle } from "hardhat"; chai.use(solidity); @@ -310,7 +309,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); @@ -1485,7 +1484,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); @@ -1724,7 +1723,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); @@ -2204,7 +2203,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); @@ -2643,7 +2642,7 @@ describe("Test for Ledger", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); diff --git a/packages/faker/scripts/createShopId.ts b/packages/faker/scripts/createShopId.ts index 10675167..92643bbf 100644 --- a/packages/faker/scripts/createShopId.ts +++ b/packages/faker/scripts/createShopId.ts @@ -5,7 +5,7 @@ import { IShopData } from "../src/types"; async function main() { const shops = JSON.parse(fs.readFileSync("./src/data/shops.json", "utf8")) as IShopData[]; for (const shop of shops) { - shop.shopId = ContractUtils.getShopId(shop.name, shop.address); + shop.shopId = ContractUtils.getShopId(shop.address); } console.log(JSON.stringify(shops)); } diff --git a/packages/faker/src/utils/ContractUtils.ts b/packages/faker/src/utils/ContractUtils.ts index 1e147e06..0020833d 100644 --- a/packages/faker/src/utils/ContractUtils.ts +++ b/packages/faker/src/utils/ContractUtils.ts @@ -91,10 +91,10 @@ export class ContractUtils { return signer.signMessage(message); } - public static getShopId(name: string, account: string): string { + public static getShopId(account: string): string { const encodedResult = hre.ethers.utils.defaultAbiCoder.encode( - ["string", "address", "bytes32"], - [name, account, crypto.randomBytes(32)] + ["address", "bytes32"], + [account, crypto.randomBytes(32)] ); return hre.ethers.utils.keccak256(encodedResult); } diff --git a/packages/relay/src/utils/ContractUtils.ts b/packages/relay/src/utils/ContractUtils.ts index 49adce96..5ed1edbe 100644 --- a/packages/relay/src/utils/ContractUtils.ts +++ b/packages/relay/src/utils/ContractUtils.ts @@ -220,10 +220,10 @@ export class ContractUtils { return res.toLowerCase() === account.toLowerCase(); } - public static getShopId(name: string, account: string): string { + public static getShopId(account: string): string { const encodedResult = hre.ethers.utils.defaultAbiCoder.encode( - ["string", "address", "bytes32"], - [name, account, crypto.randomBytes(32)] + ["address", "bytes32"], + [account, crypto.randomBytes(32)] ); return hre.ethers.utils.keccak256(encodedResult); } diff --git a/packages/relay/test/Endpoints.test.ts b/packages/relay/test/Endpoints.test.ts index daaed4a6..b1fa44a6 100644 --- a/packages/relay/test/Endpoints.test.ts +++ b/packages/relay/test/Endpoints.test.ts @@ -254,7 +254,7 @@ describe("Test of Server", function () { context("Test token & point relay endpoints", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); diff --git a/packages/relay/test/Shop.test.ts b/packages/relay/test/Shop.test.ts index 03f9aa38..d494aacf 100644 --- a/packages/relay/test/Shop.test.ts +++ b/packages/relay/test/Shop.test.ts @@ -226,7 +226,7 @@ describe("Test for ShopCollection", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } }); diff --git a/packages/relay/test/ShopWithdraw.test.ts b/packages/relay/test/ShopWithdraw.test.ts index 90f42a95..b93cf5c1 100644 --- a/packages/relay/test/ShopWithdraw.test.ts +++ b/packages/relay/test/ShopWithdraw.test.ts @@ -324,7 +324,7 @@ describe("Test for ShopCollection", () => { before("Set Shop ID", async () => { for (const elem of shopData) { - elem.shopId = ContractUtils.getShopId(elem.name, elem.wallet.address); + elem.shopId = ContractUtils.getShopId(elem.wallet.address); } });