Skip to content

Commit

Permalink
Merge pull request #1459 from o1-labs/feat/helpful-actions-error-msg
Browse files Browse the repository at this point in the history
Update error message for undefined GraphQL endpoint for actions/events
  • Loading branch information
MartinMinkov authored Feb 23, 2024
2 parents 24537f7 + 2e7395a commit e76ca45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Changed

- Improve all-around performance by reverting the Apple silicon workaround (https://github.com/o1-labs/o1js/pull/683) as the root problem is now fixed upstream https://github.com/o1-labs/o1js/pull/1456
- Improved error message when trying to use `fetchActions`/`fetchEvents` with a missing Archive Node endpoint https://github.com/o1-labs/o1js/pull/1459

### Deprecated

Expand Down
8 changes: 4 additions & 4 deletions src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ async function fetchEvents(
filterOptions: EventActionFilterOptions = {}
) {
if (!graphqlEndpoint)
throw new Error(
'fetchEvents: Specified GraphQL endpoint is undefined. Please specify a valid endpoint.'
throw Error(
'fetchEvents: Specified GraphQL endpoint is undefined. When using events, you must set the archive node endpoint in Mina.Network(). Please ensure your Mina.Network() configuration includes an archive node endpoint.'
);
const { publicKey, tokenId } = accountInfo;
let [response, error] = await makeGraphqlRequest<EventQueryResponse>(
Expand Down Expand Up @@ -689,8 +689,8 @@ async function fetchActions(
graphqlEndpoint = networkConfig.archiveEndpoint
) {
if (!graphqlEndpoint)
throw new Error(
'fetchActions: Specified GraphQL endpoint is undefined. Please specify a valid endpoint.'
throw Error(
'fetchActions: Specified GraphQL endpoint is undefined. When using actions, you must set the archive node endpoint in Mina.Network(). Please ensure your Mina.Network() configuration includes an archive node endpoint.'
);
const {
publicKey,
Expand Down

0 comments on commit e76ca45

Please sign in to comment.