From ff199d4b021b3992299a66210fd940286816a24b Mon Sep 17 00:00:00 2001 From: ryanwolhuter Date: Fri, 27 Oct 2023 13:54:15 +0200 Subject: [PATCH] apply formatting Signed-off-by: ryanwolhuter --- snapshot-spaces | 2 +- src/components/BaseModalSelectItem.vue | 2 +- src/components/SpaceCreateVoting.vue | 172 ++++++++++++------------ src/composables/useFollowSpace.ts | 7 +- src/plugins/oSnap/types.ts | 25 ++-- src/plugins/oSnap/utils/events.ts | 2 +- src/plugins/oSnap/utils/getters.ts | 18 +-- src/plugins/safeSnap/utils/umaModule.ts | 2 +- src/views/PlaygroundView.vue | 4 +- 9 files changed, 120 insertions(+), 114 deletions(-) diff --git a/snapshot-spaces b/snapshot-spaces index c966f1940..d412e6309 160000 --- a/snapshot-spaces +++ b/snapshot-spaces @@ -1 +1 @@ -Subproject commit c966f1940009b913121fb43c512f7be1ab06b592 +Subproject commit d412e63090477e71c2e3b693651501394efd7679 diff --git a/src/components/BaseModalSelectItem.vue b/src/components/BaseModalSelectItem.vue index 2228e3c37..778487c18 100644 --- a/src/components/BaseModalSelectItem.vue +++ b/src/components/BaseModalSelectItem.vue @@ -23,7 +23,7 @@ defineProps<{ /> {{ tag }} - + diff --git a/src/components/SpaceCreateVoting.vue b/src/components/SpaceCreateVoting.vue index f315bc59f..2ff54bc24 100644 --- a/src/components/SpaceCreateVoting.vue +++ b/src/components/SpaceCreateVoting.vue @@ -120,94 +120,94 @@ defineEmits<{ @update:type="value => (form.type = value)" /> -

-
-
- +
+
+ > + +
- - - -
- - - +
+ + +
- - - - - - - -
+
+ + + +
+ + + +
+
+ + + + + + +
diff --git a/src/composables/useFollowSpace.ts b/src/composables/useFollowSpace.ts index 12cebc5e1..e7ca8bedf 100644 --- a/src/composables/useFollowSpace.ts +++ b/src/composables/useFollowSpace.ts @@ -87,7 +87,12 @@ export function useFollowSpace(spaceId: any = {}) { } catch (e: any) { loadingFollow.value = ''; console.error(e); - notify(['red', e?.error_description ? `Oops, ${e.error_description}` : t('notify.somethingWentWrong')]); + notify([ + 'red', + e?.error_description + ? `Oops, ${e.error_description}` + : t('notify.somethingWentWrong') + ]); } } diff --git a/src/plugins/oSnap/types.ts b/src/plugins/oSnap/types.ts index 794599939..e42238ed8 100644 --- a/src/plugins/oSnap/types.ts +++ b/src/plugins/oSnap/types.ts @@ -244,7 +244,7 @@ export type OsnapPluginData = { /** * Represents the data associated with an assertion on the Optimistic Oracle V3 subgraph. - * + * * @field `assertionId` field is the id of the assertion. * @field `expirationTime` field is the time that the assertion's challenge period ends. * @field `assertionHash` field is the transaction hash from when the assertion was made. @@ -265,7 +265,7 @@ export type AssertionGql = { /** * Represents the configuration of the Optimistic Governor module contract that was deployed for a given Safe. - * + * * @field `moduleAddress` field is the address of the specific Optimistic Governor module contract that was deployed for a given Safe. * @field `oracleAddress` field is the address of the Optimistic Oracle V3 contract. * @field `rules` rules for this Optimistic Governor contract. @@ -282,7 +282,7 @@ export type OGModuleDetails = { /** * Represents the collateral configuration for a given Optimistic Governor contract. - * + * * @field `erc20Contract` field is the ERC20 contract that is used for collateral. * @field `address` field is the address of the ERC20 contract that is used for collateral. * @field `symbol` field is the symbol of the ERC20 contract that is used for collateral. @@ -297,7 +297,7 @@ export type CollateralDetails = { /** * Event fired when an assertion is made on the Optimistic Oracle V3 contract. - * + * * @field `assertionId` field is the id of the assertion. * @field `domainId` field is the domain id of the assertion. * @field `claim` field is the claim of the assertion. @@ -328,7 +328,7 @@ export type AssertionMadeEvent = Event & { /** * Event fired when transactions are proposed on the Optimistic Governor contract. - * + * * @field `proposer` field is the address of the proposer. * @field `proposalTime` field is the time that the proposal was made. * @field `assertionId` field is the id of the assertion. @@ -356,7 +356,7 @@ export type TransactionsProposedEvent = Event & { /** * Event fired when an Optimistic Governor proposal's transactions are executed successfully. - * + * * @field `proposalHash` field is the hash of the proposal. * @field `assertionId` field is the id of the assertion. */ @@ -367,10 +367,9 @@ export type ProposalExecutedEvent = Event & { }; }; - /** * Represents the transaction hash and log index of an `AssertionMade` event. - * + * * We need these for generating a link to the assertion on the Optimistic Oracle dapp. */ export type AssertionTransactionDetails = { @@ -380,15 +379,15 @@ export type AssertionTransactionDetails = { /** * Represents the state of a proposal on the Optimistic Governor contract. When an assertion is associated with the proposal, we also include the assertion transaction hash and log index so that we can create a link to the assertion on the Optimistic Oracle dapp. - * + * * There are four states that a proposal can be in: - * + * * - `can-propose-to-og`: The user can propose transactions to the Optimistic Governor contract. This is the initial state of a proposal. We also indicate if this proposal has been disputed in the Oracle, so that we can warn the user to exercise caution and avoid losing their bond. - * + * * - `in-oo-challenge-period`: The user has proposed transactions to the Optimistic Governor contract, and the proposal is currently in the challenge period on the Optimistic Oracle contract. We also indicate when the challenge period ends, so that we can warn the user to wait until the challenge period ends before proposing new transactions. - * + * * - `can-request-tx-execution`: The user has proposed transactions to the Optimistic Governor contract, and the challenge period has ended. The user can now request that the Optimistic Governor contract execute the transactions. - * + * * - `transactions-executed`: The user has proposed transactions to the Optimistic Governor contract, the challenge period has ended, and the transactions have been executed by the Optimistic Governor contract. */ export type OGProposalState = diff --git a/src/plugins/oSnap/utils/events.ts b/src/plugins/oSnap/utils/events.ts index 510507ce6..4a195b63b 100644 --- a/src/plugins/oSnap/utils/events.ts +++ b/src/plugins/oSnap/utils/events.ts @@ -168,4 +168,4 @@ export async function getPagedEvents(params: { eventPager ); return pagedEvents as EventType[]; -} \ No newline at end of file +} diff --git a/src/plugins/oSnap/utils/getters.ts b/src/plugins/oSnap/utils/getters.ts index 4aa97a59f..cbbfe337c 100644 --- a/src/plugins/oSnap/utils/getters.ts +++ b/src/plugins/oSnap/utils/getters.ts @@ -293,7 +293,7 @@ async function getAssertionGql(params: { } /** * Fetches the details of a given proposal from the Optimistic Governor subgraph. - * + * * The subgraph uses the `assertionId` that comes from assertion events as the primary key for proposals. * However, this `assertionId` will be deleted if the proposal is disputed, so we can't use it to query the subgraph. * Instead, we use the `proposalHash` and `explanation` to query the subgraph. @@ -337,7 +337,7 @@ async function getOgProposalGql(params: { /** * Fetches the details of a Optimistic Governor module's collateral token. - * + * * Returns the address, symbol, and decimals of the collateral token, along with the token contract for further querying. */ export async function getCollateralDetailsForProposal( @@ -386,7 +386,7 @@ export async function getUserCollateralBalance( /** * Fetches the details of a given Optimistic Governor module from the chain. - * + * * Performs a multicall to fetch the oracle address, rules, minimum bond, and challenge period. */ export async function getOGModuleDetails(params: { @@ -424,11 +424,11 @@ export async function getOGModuleDetails(params: { /** * Fetches the state of an Optimistic Governor proposal from the chain. - * + * * This is a fallback function that should only be used if the subgraph is not available, because it is very slow. - * + * * The contract is designed in such a way that it deletes the `assertionId` from the proposal if the proposal is disputed, _or_ if the transactions are executed successfully. This means we can't tell the difference between a proposal that has not yet been proposed, has been disputed, or that has been executed by querying the chain. - * + * * Instead, we must query the chain for the proposal events, and then query the chain for the execution events, and then compare the two to determine the state of the proposal. This is very slow. */ export async function getOgProposalStateFromChain(params: { @@ -583,7 +583,7 @@ export async function getOgProposalStateFromChain(params: { /** * Fetches the state of an Optimistic Governor proposal from the subgraph. - * + * * This is the preferred method of fetching the state of a proposal, because it is much faster than querying the chain. */ export async function getOGProposalStateGql(params: { @@ -672,7 +672,7 @@ function assertionIdIsNotZero(assertionId: string) { /** * Fetches the state of an Optimistic Governor proposal. - * + * * This function will attempt to fetch the state of a proposal from the subgraph, and if that fails, it will fall back to querying the chain. */ export async function getOGProposalState(params: { @@ -689,7 +689,7 @@ export async function getOGProposalState(params: { network, moduleAddress, explanation, - proposalHash, + proposalHash }); } catch (error) { console.warn( diff --git a/src/plugins/safeSnap/utils/umaModule.ts b/src/plugins/safeSnap/utils/umaModule.ts index d7ff7d58f..181509d22 100644 --- a/src/plugins/safeSnap/utils/umaModule.ts +++ b/src/plugins/safeSnap/utils/umaModule.ts @@ -306,7 +306,7 @@ export const getModuleDetailsUma = async ( const assertion = await oracleContract.getAssertion( event.args?.assertionId ); - + const isExpired = Math.floor(Date.now() / 1000) >= assertion.expirationTime.toNumber(); diff --git a/src/views/PlaygroundView.vue b/src/views/PlaygroundView.vue index 9084b04fd..924dad882 100644 --- a/src/views/PlaygroundView.vue +++ b/src/views/PlaygroundView.vue @@ -250,7 +250,9 @@ function handleNetworkSelect(value) { class="mt-3 overflow-x-auto" style="border-color: red !important" > -
 {{ strategyError }}
+
+ {{ strategyError }}