generated from okp4/template-oss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mapping): add forget object handler
- Loading branch information
ErikssonJoakim
committed
Aug 4, 2023
1 parent
cef12c4
commit 287c9c1
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
//Exports all handler functions | ||
export * from "./mappings/handleStoreObject"; | ||
export * from "./mappings/handleForgetObject"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { CosmosMessage } from "@subql/types-cosmos"; | ||
import type { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; | ||
import { ObjectariumObject } from "../types"; | ||
import { getObjectariumObjectId } from "../utils/utils"; | ||
|
||
export const handleForgetObject = async ( | ||
msg: CosmosMessage<MsgExecuteContract> | ||
): Promise<void> => { | ||
const objectId = getObjectariumObjectId(msg.tx.tx.events); | ||
|
||
objectId && ObjectariumObject.remove(objectId); | ||
}; |