-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
L1EP missing gauntlet commands for e2e tests #298
Open
sdrug
wants to merge
7
commits into
develop
Choose a base branch
from
feature/l1ep-e2e-testing-gauntlet-commands
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e054642
MockAggregator to behave as an L1GasPriceFeed
sdrug dd0c65a
L1 AccessController gauntlet deploy command
sdrug e54fed5
L1 MockAggregator deploy and set_answer gauntlet commands
sdrug a187748
Folder renamings & cleanup
sdrug 46a509a
Adjusting MockAggregator ux description
sdrug 9a9b26a
Handling optional input for MockAggregator set_answer command
sdrug f347b35
Adjusting AccessController ux description
sdrug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
contract MockAggregator { | ||
int256 public s_answer; | ||
|
||
function setLatestAnswer(int256 answer) public { | ||
s_answer = answer; | ||
} | ||
|
||
function latestAnswer() public view returns (int256) { | ||
return s_answer; | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
packages-ts/starknet-gauntlet-emergency-protocol/src/commands/L1AccessController/deploy.ts
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { EVMExecuteCommandConfig, makeEVMExecuteCommand } from '@chainlink/evm-gauntlet' | ||
import { CATEGORIES } from '../../lib/categories' | ||
import { L1AccessControllerContractLoader, CONTRACT_LIST } from '../../lib/contracts' | ||
|
||
type UserInput = {} | ||
|
||
type ContractInput = [] | ||
|
||
const makeUserInput = async (flags, args, env): Promise<UserInput> => ({}) | ||
|
||
const makeContractInput = async (input: UserInput): Promise<ContractInput> => { | ||
return [] | ||
} | ||
|
||
const commandConfig: EVMExecuteCommandConfig<UserInput, ContractInput> = { | ||
contractId: CONTRACT_LIST.L1_ACCESS_CONTROLLER, | ||
category: CATEGORIES.L1_ACCESS_CONTROLLER, | ||
action: 'deploy', | ||
ux: { | ||
description: 'Deploy an AccessController', | ||
examples: [`${CATEGORIES.L1_ACCESS_CONTROLLER}:deploy --network=<NETWORK>`], | ||
}, | ||
makeUserInput, | ||
makeContractInput, | ||
validations: [], | ||
loadContract: L1AccessControllerContractLoader, | ||
} | ||
|
||
export default makeEVMExecuteCommand(commandConfig) |
3 changes: 3 additions & 0 deletions
3
packages-ts/starknet-gauntlet-emergency-protocol/src/commands/L1AccessController/index.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Deploy from './deploy' | ||
|
||
export default [Deploy] |
29 changes: 29 additions & 0 deletions
29
packages-ts/starknet-gauntlet-emergency-protocol/src/commands/L1GasPriceFeed/deploy.ts
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { EVMExecuteCommandConfig, makeEVMExecuteCommand } from '@chainlink/evm-gauntlet' | ||
import { CATEGORIES } from '../../lib/categories' | ||
import { L1MockAggregatorLoader, CONTRACT_LIST } from '../../lib/contracts' | ||
|
||
type UserInput = {} | ||
|
||
type ContractInput = [] | ||
|
||
const makeUserInput = async (flags, args, env): Promise<UserInput> => ({}) | ||
|
||
const makeContractInput = async (input: UserInput): Promise<ContractInput> => { | ||
return [] | ||
} | ||
|
||
const commandConfig: EVMExecuteCommandConfig<UserInput, ContractInput> = { | ||
contractId: CONTRACT_LIST.L1_MOCK_AGGREGATOR, | ||
category: CATEGORIES.L1_MOCK_AGGREGATOR, | ||
action: 'deploy', | ||
ux: { | ||
description: 'Deploy an MockAggregator', | ||
examples: [`${CATEGORIES.L1_MOCK_AGGREGATOR}:deploy --network=<NETWORK>`], | ||
}, | ||
makeUserInput, | ||
makeContractInput, | ||
validations: [], | ||
loadContract: L1MockAggregatorLoader, | ||
} | ||
|
||
export default makeEVMExecuteCommand(commandConfig) |
4 changes: 4 additions & 0 deletions
4
packages-ts/starknet-gauntlet-emergency-protocol/src/commands/L1GasPriceFeed/index.ts
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Deploy from './deploy' | ||
import SetAnswer from './setAnswer' | ||
|
||
export default [Deploy, SetAnswer] |
39 changes: 39 additions & 0 deletions
39
packages-ts/starknet-gauntlet-emergency-protocol/src/commands/L1GasPriceFeed/setAnswer.ts
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { EVMExecuteCommandConfig, makeEVMExecuteCommand } from '@chainlink/evm-gauntlet' | ||
import { CATEGORIES } from '../../lib/categories' | ||
import { L1MockAggregatorLoader, CONTRACT_LIST } from '../../lib/contracts' | ||
|
||
type UserInput = { | ||
answer: number | ||
} | ||
|
||
type ContractInput = [number] | ||
|
||
const makeUserInput = async (flags, args, env): Promise<UserInput> => { | ||
if (flags.input) return flags.input as UserInput | ||
return { | ||
answer: flags.answer, | ||
} | ||
} | ||
|
||
const makeContractInput = async (input: UserInput): Promise<ContractInput> => { | ||
return [Number(input.answer)] | ||
} | ||
|
||
const commandConfig: EVMExecuteCommandConfig<UserInput, ContractInput> = { | ||
contractId: CONTRACT_LIST.L1_MOCK_AGGREGATOR, | ||
category: CATEGORIES.L1_MOCK_AGGREGATOR, | ||
action: 'set_answer', | ||
internalFunction: 'setLatestAnswer', | ||
ux: { | ||
description: 'Set the static LatestAnswer', | ||
examples: [ | ||
`${CATEGORIES.L1_MOCK_AGGREGATOR}:set_answer --network=<NETWORK> --answer=<ANSWER> <AGGREGATOR_CONTRACT>`, | ||
], | ||
}, | ||
makeUserInput, | ||
makeContractInput, | ||
validations: [], | ||
loadContract: L1MockAggregatorLoader, | ||
} | ||
|
||
export default makeEVMExecuteCommand(commandConfig) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,6 +331,25 @@ | |
dependencies: | ||
"@eth-optimism/contracts" "^0.5.21" | ||
|
||
"@chainlink/[email protected]": | ||
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/@chainlink/evm-gauntlet-common/-/evm-gauntlet-common-0.3.1.tgz#7a1d82a5300f1f1f70b92de37bc77d987ffa86b7" | ||
integrity sha512-+aaIFvMEqoEeEOfUkgUW/Kn/ACuPB5ysNEvJLfZpzaP7x+h3oV1EbtQ+f3k/tkqnEHdsXX/KoeVS2nEZfe4CDA== | ||
dependencies: | ||
"@chainlink/evm-gauntlet" "*" | ||
"@chainlink/gauntlet-contracts-link" "*" | ||
"@chainlink/gauntlet-core" "0.6.0" | ||
"@chainlink/zksync-gauntlet" "*" | ||
ethers "^5.7.0" | ||
|
||
"@chainlink/evm-gauntlet@*": | ||
version "0.12.0" | ||
resolved "https://registry.yarnpkg.com/@chainlink/evm-gauntlet/-/evm-gauntlet-0.12.0.tgz#639f1e308735807016eb5d4ef6c6e25d21255604" | ||
integrity sha512-LAvomZD70AhSkz8sycNepchypke4UoD61lyjb+i6Wxpq+K7jiTfBNgHOpiLtOvlnVrJfgYEhoBGlfj3F7Xeq4Q== | ||
dependencies: | ||
"@chainlink/gauntlet-core" "0.6.0" | ||
ethers "^5.6.9" | ||
|
||
"@chainlink/[email protected]": | ||
version "0.1.0" | ||
resolved "https://registry.yarnpkg.com/@chainlink/evm-gauntlet/-/evm-gauntlet-0.1.0.tgz#cf5cdbf66f1126b5b1d23fa8d494ab4598317674" | ||
|
@@ -362,6 +381,13 @@ | |
dependencies: | ||
"@chainlink/gauntlet-core" "*" | ||
|
||
"@chainlink/gauntlet-contracts-link@*": | ||
version "0.1.3" | ||
resolved "https://registry.yarnpkg.com/@chainlink/gauntlet-contracts-link/-/gauntlet-contracts-link-0.1.3.tgz#3107c4773df8a378ac88e6e5b4c87fa80a4cf6ca" | ||
integrity sha512-+OzDDljKBe2q2g66rOUYa+i1KL5ZUeRJb/mmK66eFyhw+sMStG/s4aXh2l2wvyBCqOxz+hmkfiyeIQsd8wHGTA== | ||
dependencies: | ||
"@chainlink/gauntlet-core" "*" | ||
|
||
"@chainlink/[email protected]": | ||
version "0.2.2" | ||
resolved "https://registry.yarnpkg.com/@chainlink/gauntlet-contracts-ocr2/-/gauntlet-contracts-ocr2-0.2.2.tgz#b2e6deab8c52abea588cad7c152bf8cc7a03ca28" | ||
|
@@ -389,6 +415,25 @@ | |
bn.js "^5.2.0" | ||
protobufjs "^6.11.2" | ||
|
||
"@chainlink/[email protected]": | ||
version "0.6.0" | ||
resolved "https://registry.yarnpkg.com/@chainlink/gauntlet-core/-/gauntlet-core-0.6.0.tgz#0a21802ea63ad0bd5948099d7c6f6e96b3868a5c" | ||
integrity sha512-e2yLhvZUHiCT1N8sDJcqoKz6LwViQL55EMp8/eTb9PQktqBRhQDHdJK0dAlolFC+BiKVbka6THUAqyTXXxZxUQ== | ||
dependencies: | ||
"@ethersproject/keccak256" "^5.5.0" | ||
axios "^0.24.0" | ||
bn.js "^5.2.0" | ||
protobufjs "^6.11.2" | ||
|
||
"@chainlink/zksync-gauntlet@*": | ||
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/@chainlink/zksync-gauntlet/-/zksync-gauntlet-0.3.1.tgz#c15d9c8648a0929ef0434a9ba9b1cf5d85d8ef55" | ||
integrity sha512-qxD4gLIHjB/Zhy9tAAl8TqJ1hHeU4X5cD9eiMoBHRnViW2ylXLY5oTxcTjxQHbwYqd/6gBz3TRFVdeMu4w/Ctg== | ||
dependencies: | ||
"@chainlink/gauntlet-core" "0.6.0" | ||
ethers "^5.7.1" | ||
zksync-web3 "^0.14.0" | ||
|
||
"@chainsafe/as-sha256@^0.3.1": | ||
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" | ||
|
@@ -3575,7 +3620,7 @@ ethereumjs-util@^7.1.0: | |
ethereum-cryptography "^0.1.3" | ||
rlp "^2.2.4" | ||
|
||
ethers@^5.6.8, ethers@^5.6.9, ethers@^5.7.1: | ||
ethers@^5.6.8, ethers@^5.6.9, ethers@^5.7.0, ethers@^5.7.1: | ||
version "5.7.2" | ||
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" | ||
integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== | ||
|
@@ -7859,3 +7904,8 @@ yocto-queue@^0.1.0: | |
version "0.1.0" | ||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" | ||
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== | ||
|
||
zksync-web3@^0.14.0: | ||
version "0.14.3" | ||
resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.3.tgz#64ac2a16d597464c3fc4ae07447a8007631c57c9" | ||
integrity sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ== |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be latestRoundData I think
https://github.com/smartcontractkit/chainlink-starknet/blob/develop/contracts/solidity/emergency/StarknetValidator.sol#L184
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sdrug are you waiting on review? I think this still needs to be changed. The line above has been changed