Skip to content

Commit

Permalink
voting fixes (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiacodes authored Oct 31, 2024
1 parent 3943aba commit d91e57c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/helpers/adapters/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const format = (

const insert = async (params: Array<object>) => {
if (params.length < 10) throw Error('Invalid parameters');
console.log('insert params', params);
const cmd =
'INSERT INTO messages (id, address, version, timestamp, space, token, type, payload, sig, metadata, "actionId", data) VALUES ' +
'($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) ON CONFLICT ON CONSTRAINT messages_pkey DO NOTHING';
Expand Down
7 changes: 5 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ router.post('/message', async (req, res) => {
if (!body || !body.address || !body.msg || !body.sig || !body.erc712Data)
return sendError(res, 'wrong message body');

console.log(msg);
console.log('msg:', msg);

if (
//[payload, timestamp, token, space, type, version] == 6
Expand Down Expand Up @@ -454,7 +454,10 @@ router.post('/message', async (req, res) => {
const { payload: payloadToParse } = proposals[0];
const payload = jsonParse(payloadToParse, payloadToParse);

const proposalStatus = await getProposalStatus(payload.proposalId, space);
const proposalStatus = await getProposalStatus(
msg.payload.proposalId,
space
);
const proposalEnd =
proposalStatus.length > 0 ? proposalStatus[0].proposalEnd : payload.end;

Expand Down

0 comments on commit d91e57c

Please sign in to comment.