Skip to content

Commit

Permalink
feat: tx decode quick, pin when pickup output
Browse files Browse the repository at this point in the history
  • Loading branch information
vaultec81 committed Dec 2, 2023
1 parent cd0325e commit 0ca901b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/api/graphql/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ export const Resolvers = {

await appContainer.self.transactionPool.processMempoolTX(root.toString())

await appContainer.self.transactionPool.txDecode(root.toString(), await appContainer.self.transactionPool.transactionPool.findOne({
id: root.toString()
}))

await appContainer.self.p2pService.memoryPoolChannel.call('announce_tx', {
payload: {
Expand Down
9 changes: 9 additions & 0 deletions src/services/chainBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ export class ChainBridge {
upsert: true
})

const contractInfo = await this.self.contractEngine.contractDb.findOne({
id: content.tx.contract_id
})
this.self.ipfs.pin.add(CID.parse(content.tx.state_merkle)).catch(e => console.log(e))

if(contractInfo) {
this.self.ipfs.pin.rm(CID.parse(contractInfo.state_merkle)).catch(e => console.log(e))
}

await this.self.contractEngine.contractDb.findOneAndUpdate({
id: content.tx.contract_id
}, {
Expand Down

0 comments on commit 0ca901b

Please sign in to comment.