-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jacqueline-57b/automation-test-cases
Add e2e test cases
- Loading branch information
Showing
13 changed files
with
448 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
TEST_WALLET_A_ADDRESS = 0x0000000000000000000000000000000000000000 | ||
TEST_WALLET_B_ADDRESS = 0x0000000000000000000000000000000000000000 | ||
TEST_WALLET_C_ADDRESS = 0x0000000000000000000000000000000000000000 | ||
PRIVATE_KEYS = privateKey1,privateKey2,privateKey3 | ||
NFT_CONTRACT_ADDRESS = 0x0000000000000000000000000000000000000000 | ||
RPC_URL = https://rpc.ankr.com/eth_sepolia | ||
LICENSE_MODULE = 0x0000000000000000000000000000000000000000 | ||
MINT_FEE_TOKEN = 0x0000000000000000000000000000000000000000 | ||
ROYALTY_POLICY = 0x0000000000000000000000000000000000000000 | ||
RPC_PROVIDER_URL=https://rpc.ankr.com/eth_sepolia | ||
WALLET_PRIVATE_KEY_A=0x0000000000000000000000000000000000000000 | ||
WALLET_PRIVATE_KEY_B=0x0000000000000000000000000000000000000000 | ||
WALLET_PRIVATE_KEY_C=0x0000000000000000000000000000000000000000 | ||
MY_NFT_CONTRACT_ADDRESS=0x0000000000000000000000000000000000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,25 @@ | ||
import "dotenv/config"; | ||
import { | ||
Hex, | ||
createWalletClient, | ||
http, | ||
PrivateKeyAccount, | ||
} from "viem"; | ||
import { Hex, http, Address } from "viem"; | ||
import { privateKeyToAccount } from "viem/accounts"; | ||
import { StoryClient, StoryConfig } from "@story-protocol/core-sdk"; | ||
|
||
import { sepolia } from "viem/chains"; | ||
|
||
export const getStoryConfig = (account: PrivateKeyAccount) => ({ | ||
transport: http(RPC_URL), | ||
account, | ||
}) as StoryConfig; | ||
export const transport = http(process.env.RPC_PROVIDER_URL); | ||
export const privateKeyA = process.env.WALLET_PRIVATE_KEY_A as Hex; | ||
export const privateKeyB = process.env.WALLET_PRIVATE_KEY_B as Hex; | ||
|
||
export const TOKEN_CONTRACT_ADDRESS = "0x7ee32b8B515dEE0Ba2F25f612A04a731eEc24F49"; | ||
export const TEST_WALLET_A_ADDRESS = (process.env.TEST_WALLET_A_ADDRESS || "0x") as `0x${string}`; | ||
export const TEST_WALLET_B_ADDRESS = (process.env.TEST_WALLET_B_ADDRESS || "0x") as `0x${string}`; | ||
export const TEST_WALLET_C_ADDRESS = (process.env.TEST_WALLET_C_ADDRESS || "0x") as `0x${string}`; | ||
export const NFT_CONTRACT_ADDRESS = (process.env.NFT_CONTRACT_ADDRESS || "0x") as `0x${string}`; | ||
export const RPC_URL = process.env.RPC_URL || ""; | ||
export const LICENSE_MODULE = (process.env.LICENSE_MODULE || "") as `0x${string}`; | ||
export const MINT_FEE_TOKEN = (process.env.MINT_FEE_TOKEN || "") as `0x${string}`; | ||
export const ROYALTY_POLICY = (process.env.ROYALTY_POLICY || "") as `0x${string}`; | ||
export const accountA = privateKeyToAccount(privateKeyA as Address); | ||
export const accountB = privateKeyToAccount(privateKeyB as Address); | ||
|
||
export const accountA = privateKeyToAccount((process.env.PRIVATE_KEYS?.split(',')[0] || '0x') as Hex); | ||
export const accountB = privateKeyToAccount((process.env.PRIVATE_KEYS?.split(',')[1] || '0x') as Hex); | ||
export const accountC = privateKeyToAccount((process.env.PRIVATE_KEYS?.split(',')[2] || '0x') as Hex); | ||
|
||
const configA: StoryConfig = getStoryConfig(accountA); | ||
const configB: StoryConfig = getStoryConfig(accountB); | ||
const configC: StoryConfig = getStoryConfig(accountC); | ||
|
||
export const storyClientA: StoryClient = StoryClient.newClient(configA); | ||
export const storyClientB: StoryClient = StoryClient.newClient(configB); | ||
export const storyClientC: StoryClient = StoryClient.newClient(configC); | ||
|
||
export const walletClientA = createWalletClient({ | ||
transport: http(RPC_URL), | ||
chain: sepolia, | ||
export const configA: StoryConfig = { | ||
account: accountA, | ||
}); | ||
export const walletClientB = createWalletClient({ | ||
transport: http(RPC_URL), | ||
chain: sepolia, | ||
transport: transport, | ||
} | ||
|
||
export const configB: StoryConfig = { | ||
account: accountB, | ||
}); | ||
export const walletClientC = createWalletClient({ | ||
transport: http(RPC_URL), | ||
chain: sepolia, | ||
account: accountC, | ||
}); | ||
transport: transport, | ||
} | ||
|
||
export const clientA = StoryClient.newClient(configA) | ||
export const clientB = StoryClient.newClient(configB) |
Oops, something went wrong.