-
Notifications
You must be signed in to change notification settings - Fork 88
fix(artillery): align init helpers, state cache, and docs #990
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
Open
Ansonhkg
wants to merge
21
commits into
naga
Choose a base branch
from
fix/artillery
base: naga
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.
+2,376
−956
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b37d23d
fix(artillery): align init helpers, state cache, and docs
Ansonhkg 7c9bc64
docs: update README with instructions for syncing contracts and confi…
Ansonhkg facbbeb
fmt
Ansonhkg 09840ca
fmt
Ansonhkg c16d129
chore(networks, naga-staging): sync contracts
Ansonhkg ff3f665
fix(artillery): update commands to use ARTILLERY_KEY from .env and ha…
Ansonhkg daae8cf
Add naga-staging
hwrdtm bc098d0
Changes from PR#924
hwrdtm ffb4adb
Fix field
hwrdtm a3e6983
Use ARTILLERY_KEY if present
hwrdtm fb1eb55
Add more lit-action variants
hwrdtm 5a36588
Fix format
hwrdtm 9805b41
Fix variant name
hwrdtm e58675a
refactor: change to eoa auth
Ansonhkg e1db48b
Add params
hwrdtm fc60961
refactor: remove unused import of AuthSig
Ansonhkg cab70d6
Merge pull request #994 from LIT-Protocol/anson/fix-artillery-howards…
hwrdtm 602658d
Tidy up decrypt scenario
hwrdtm 8cc0ea3
Validate decrypted response from LA
hwrdtm 75f2aa5
Fix sign session key
hwrdtm 8cc11b1
Merge pull request #991 from LIT-Protocol/hwrdtm/fixes
Ansonhkg 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ export const readFile = async (): Promise<State> => { | |
|
|
||
| // If content is empty object, write base state | ||
| if (Object.keys(content).length === 0) { | ||
| await fs.writeFile(FILE_NAME, JSON.stringify(StateObject, null, 2)); | ||
| await fs.writeFile(FILE_NAME, stringify(StateObject)); | ||
| return StateObject; | ||
| } | ||
|
|
||
|
|
@@ -42,7 +42,7 @@ export const readFile = async (): Promise<State> => { | |
|
|
||
| // create the file if it doesn't exist | ||
| export const createFile = async () => { | ||
| await fs.writeFile(FILE_NAME, JSON.stringify(StateObject, null, 2)); | ||
| await fs.writeFile(FILE_NAME, stringify(StateObject)); | ||
| }; | ||
|
|
||
| // Type-safe field paths - dynamically derived from State type | ||
|
|
@@ -93,7 +93,7 @@ export const updateField = async <T extends StatePaths>( | |
| state[rootKey] !== null | ||
| ) { | ||
| (state[rootKey] as any)[nestedKey] = value; | ||
| await fs.writeFile(FILE_NAME, JSON.stringify(state, null, 2)); | ||
| await fs.writeFile(FILE_NAME, stringify(state)); | ||
| } else { | ||
| throw new Error(`Invalid path: ${path}`); | ||
| } | ||
|
|
@@ -123,7 +123,7 @@ export const getOrUpdate = async <T extends StatePaths>( | |
|
|
||
| // Otherwise, update with default value and return it | ||
| (state as any)[path] = defaultValue; | ||
| await fs.writeFile(FILE_NAME, JSON.stringify(state, null, 2)); | ||
| await fs.writeFile(FILE_NAME, stringify(state)); | ||
| return defaultValue; | ||
| } else { | ||
| // Nested property | ||
|
|
@@ -144,10 +144,17 @@ export const getOrUpdate = async <T extends StatePaths>( | |
|
|
||
| // Otherwise, update with default value and return it | ||
| (state[rootKey] as any)[nestedKey] = defaultValue; | ||
| await fs.writeFile(FILE_NAME, JSON.stringify(state, null, 2)); | ||
| await fs.writeFile(FILE_NAME, stringify(state)); | ||
| return defaultValue; | ||
| } else { | ||
| throw new Error(`Invalid path: ${path}`); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| const stringify = (value: unknown) => | ||
| JSON.stringify( | ||
| value, | ||
| (_, val) => (typeof val === 'bigint' ? val.toString() : val), | ||
| 2 | ||
| ); | ||
|
Comment on lines
+155
to
+160
|
||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.