-
Notifications
You must be signed in to change notification settings - Fork 20
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 #408 from smartcontractkit/rm-gauntlet-examples
Remove gauntlet example commands (we no longer use it for examples/) and fix ConfigSet parsing
- Loading branch information
Showing
9 changed files
with
27 additions
and
193 deletions.
There are no files selected for viewing
11 changes: 0 additions & 11 deletions
11
packages-ts/starknet-gauntlet-ocr2/src/commands/example/declare.ts
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
packages-ts/starknet-gauntlet-ocr2/src/commands/example/deploy.ts
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
packages-ts/starknet-gauntlet-ocr2/src/commands/example/index.ts
This file was deleted.
Oops, something went wrong.
75 changes: 0 additions & 75 deletions
75
packages-ts/starknet-gauntlet-ocr2/src/commands/example/inspect.ts
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
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 |
---|---|---|
@@ -1,28 +1,9 @@ | ||
import { encoding } from '@chainlink/gauntlet-contracts-ocr2' | ||
import { feltsToBytes } from '@chainlink/starknet-gauntlet' | ||
import { BigNumberish } from 'starknet' | ||
|
||
export const decodeOffchainConfigFromEventData = (data: string[]): encoding.OffchainConfig => { | ||
// The ConfigSet event is defined as: | ||
// fn ConfigSet( | ||
// previous_config_block_number: u64, (key) | ||
// latest_config_digest: felt252, (key) | ||
// config_count: u64, | ||
// oracles: Array<OracleConfig>, | ||
// f: u8, | ||
// onchain_config: Array<felt252>, | ||
// offchain_config_version: u64, | ||
// offchain_config: Array<felt252>, | ||
//) | ||
const oraclesLenIndex = 1 | ||
const oraclesLen = Number(BigInt(data[oraclesLenIndex])) | ||
const oracleStructSize = 2 | ||
const fIndex = oraclesLenIndex + oraclesLen * oracleStructSize + 1 | ||
const onchainConfigLenIndex = fIndex + 1 | ||
const onchainConfigLen = Number(BigInt(data[onchainConfigLenIndex])) | ||
const offchainConfigVersionIndex = onchainConfigLenIndex + onchainConfigLen + 1 | ||
const offchainConfigArrayLenIndex = offchainConfigVersionIndex + 1 | ||
const offchainConfigStartIndex = offchainConfigArrayLenIndex + 1 | ||
|
||
const offchainConfigFelts = data.slice(offchainConfigStartIndex) | ||
return encoding.deserializeConfig(feltsToBytes(offchainConfigFelts)) | ||
export const decodeOffchainConfigFromEventData = ( | ||
data: BigNumberish[], | ||
): encoding.OffchainConfig => { | ||
return encoding.deserializeConfig(feltsToBytes(data)) | ||
} |
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