Skip to content

Commit

Permalink
fix: fix invalid voting delay when set from space (#1020)
Browse files Browse the repository at this point in the history
* fix: fix invalid voting delay when set from space

* refactor: set proposal start and end time only in Editor
  • Loading branch information
wa0x6e authored Dec 5, 2024
1 parent 12af42f commit 8c28fad
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/ui/src/composables/useActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export function useActions() {
choices: string[],
labels: string[],
app: string,
created: number,
start: number,
min_end: number,
max_end: number,
Expand All @@ -312,6 +313,7 @@ export function useActions() {
choices,
labels,
app,
created,
start,
min_end,
max_end,
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/networks/evm/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export function createActions(
choices: string[],
labels: string[],
app: string,
created: number,
start: number,
min_end: number,
max_end: number,
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/networks/offchain/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ export function createActions(
choices: string[],
labels: string[],
app: string,
created: number,
start: number,
min_end: number,
max_end: number,
executions: ExecutionInfo[]
) {
const provider = getProvider(space.snapshot_chain_id as number);

const plugins = await getPlugins(executions);

const data = {
Expand All @@ -153,7 +153,7 @@ export function createActions(
snapshot: (await provider.getBlockNumber()) - EDITOR_SNAPSHOT_OFFSET,
plugins: JSON.stringify(plugins),
app: app || EDITOR_APP_NAME,
timestamp: Math.floor(Date.now() / 1000)
timestamp: created
};

return client.propose({ signer: web3.getSigner(), data });
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/networks/starknet/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export function createActions(
choices: string[],
labels: string[],
app: string,
created: number,
start: number,
min_end: number,
max_end: number,
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/networks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export type ReadOnlyNetworkActions = {
choices: string[],
labels: string[],
app: string,
created: number,
start: number,
min_end: number,
max_end: number,
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/views/Space/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ async function handleProposeClick() {
choices,
proposal.value.labels,
appName.length <= 128 ? appName : '',
currentTime,
start,
minEnd,
maxEnd,
Expand Down

0 comments on commit 8c28fad

Please sign in to comment.