-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add a route for debug addresses to get all events * chore: add debug section to get all events
- Loading branch information
Showing
6 changed files
with
73 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { useState } from 'react' | ||
|
||
import { Button } from 'decentraland-ui/dist/components/Button/Button' | ||
|
||
import { Governance } from '../../clients/Governance' | ||
import Heading from '../Common/Typography/Heading' | ||
import ErrorMessage from '../Error/ErrorMessage' | ||
import { ContentSection } from '../Layout/ContentLayout' | ||
|
||
interface Props { | ||
className?: string | ||
} | ||
|
||
function QueryData({ className }: Props) { | ||
const [errorMessage, setErrorMessage] = useState<string | undefined>() | ||
|
||
const handleGetAllEvents = async () => { | ||
setErrorMessage('') | ||
try { | ||
console.log(await Governance.get().getAllEvents()) | ||
} catch (e: unknown) { | ||
setErrorMessage(`${e}`) | ||
} | ||
} | ||
|
||
return ( | ||
<div className={className}> | ||
<ContentSection> | ||
<Heading size="sm">{'Query Data'}</Heading> | ||
<div> | ||
<Button primary onClick={handleGetAllEvents}> | ||
{'Get All Events'} | ||
</Button> | ||
</div> | ||
{errorMessage && <ErrorMessage label={'Latest error'} errorMessage={errorMessage} />} | ||
</ContentSection> | ||
</div> | ||
) | ||
} | ||
|
||
export default QueryData |
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