fixup backend
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 31s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 31s
Details
This commit is contained in:
parent
fb3f842355
commit
4e9ebfa7c3
|
@ -13,9 +13,8 @@ const port = process.env.API_LISTEN_PORT || 3000;
|
|||
app.use(express.json());
|
||||
|
||||
app.post('/write', async (req, res) => {
|
||||
const { hash, data } = await write(req.body);
|
||||
const { hash } = await write(req.body);
|
||||
console.log('write', hash);
|
||||
console.log(data);
|
||||
res.send(hash);
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const { sendNewProposalEvent } = require('../matrix-bot/outbound-queue');
|
|||
|
||||
// Subscribe to proposal events
|
||||
const start = () => {
|
||||
console.log('registering proposal listener');
|
||||
console.log('registering proposal listener for proposal notifier');
|
||||
proposals.on('NewProposal', async (proposalIndex) => {
|
||||
console.log('New Proposal, index', proposalIndex);
|
||||
|
||||
|
@ -32,6 +32,11 @@ const start = () => {
|
|||
// The outbound queue handles deduplication
|
||||
sendNewProposalEvent(proposalIndex, message);
|
||||
});
|
||||
|
||||
proposals.on('ProposalAccepted', async (proposalIndex) => {
|
||||
console.log('Proposal Accepted, index:', proposalIndex);
|
||||
// TODO: Send notification as a reply to the new proposal message
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -23,7 +23,7 @@ const gateByProposal = async (enable) => {
|
|||
// Register a ProposalAccepted event handler.
|
||||
console.log(`STOP_PROPOSAL_ID ${STOP_PROPOSAL_ID} proposal is stage ${proposal.stage.toString()}. Registering listener.`);
|
||||
const proposalAcceptedHandler = (proposalIndex) => {
|
||||
if (proposalIndex === STOP_PROPOSAL_ID) {
|
||||
if (proposalIndex.toString() === STOP_PROPOSAL_ID) {
|
||||
console.log(`STOP_PROPOSAL_ID ${STOP_PROPOSAL_ID} proposal is accepted. Disabling staking.`);
|
||||
enable(false);
|
||||
proposals.off('ProposalAccepted', proposalAcceptedHandler);
|
||||
|
@ -47,7 +47,7 @@ const gateByProposal = async (enable) => {
|
|||
// Register a ProposalAccepted event handler.
|
||||
console.log(`START_PROPOSAL_ID ${START_PROPOSAL_ID} proposal is stage ${proposal.stage.toString()}. Registering listener.`);
|
||||
const proposalAcceptedHandler = (proposalIndex) => {
|
||||
if (proposalIndex === START_PROPOSAL_ID) {
|
||||
if (proposalIndex.toString() === START_PROPOSAL_ID) {
|
||||
console.log(`START_PROPOSAL_ID ${START_PROPOSAL_ID} proposal is accepted. Enabling staking.`);
|
||||
enable(true);
|
||||
proposals.off('ProposalAccepted', proposalAcceptedHandler);
|
||||
|
@ -58,4 +58,4 @@ const gateByProposal = async (enable) => {
|
|||
}
|
||||
};
|
||||
|
||||
export default gateByProposal;
|
||||
module.exports = gateByProposal;
|
||||
|
|
|
@ -9,7 +9,6 @@ const verifySignature = ({
|
|||
}
|
||||
try {
|
||||
const account = recoverPersonalSignature({ data: contentToVerify, signature });
|
||||
console.log({ sender, account, authors });
|
||||
const addresses = authors
|
||||
.map((author) => author.authorAddress)
|
||||
.concat(sender ? [sender] : [])
|
||||
|
|
Loading…
Reference in New Issue