Skip to content

Commit

Permalink
Add protVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Oct 31, 2023
1 parent f6d2607 commit a1a1217
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/server/datahub/generated-mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export type CreatePostOffChainInput = {
callData?: InputMaybe<SocialCallDataInput>
content?: InputMaybe<Scalars['String']['input']>
dataType: SocialEventDataType
protVersion?: InputMaybe<Scalars['String']['input']>
providerAddr: Scalars['String']['input']
sig: Scalars['String']['input']
}
Expand Down
6 changes: 6 additions & 0 deletions src/services/subsocial/datahub/posts/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
socialCallName,
SocialEventDataApiInput,
SocialEventDataType,
socialEventProtVersion,
SynthCreatePostTxFailedCallParsedArgs,
SynthCreatePostTxRetryCallParsedArgs,
SynthUpdatePostTxFailedCallParsedArgs,
Expand Down Expand Up @@ -51,7 +52,9 @@ async function createPostData({
ipfsSrc: cid,
}

// TODO: refactor input to reduce duplication with other inputs
const input: SocialEventDataApiInput = {
protVersion: socialEventProtVersion['0.1'],
dataType: SocialEventDataType.optimistic,
callData: {
name: socialCallName.create_post,
Expand Down Expand Up @@ -91,6 +94,7 @@ async function updatePostData({
}

const input: SocialEventDataApiInput = {
protVersion: socialEventProtVersion['0.1'],
dataType: SocialEventDataType.optimistic,
callData: {
name: socialCallName.update_post,
Expand Down Expand Up @@ -150,6 +154,7 @@ async function notifyCreatePostFailedOrRetryStatus({
}

const input: SocialEventDataApiInput = {
protVersion: socialEventProtVersion['0.1'],
dataType: SocialEventDataType.offChain,
callData: {
name: event.name,
Expand Down Expand Up @@ -213,6 +218,7 @@ async function notifyUpdatePostFailedOrRetryStatus({
}

const input: SocialEventDataApiInput = {
protVersion: socialEventProtVersion['0.1'],
dataType: SocialEventDataType.offChain,
callData: {
name: event.name,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6582,7 +6582,7 @@

"@subsocial/data-hub-sdk@dappforce/subsocial-data-hub-sdk#staging":
version "0.0.2"
resolved "https://codeload.github.com/dappforce/subsocial-data-hub-sdk/tar.gz/ea6cb03324f874d48db89158c5029dd37a7ff7e4"
resolved "https://codeload.github.com/dappforce/subsocial-data-hub-sdk/tar.gz/9c7856aa4a457428ddf4c810b18551d1799384c1"
dependencies:
"@subsocial/api" "^0.8.13"
"@swc/core" "^1.3.55"
Expand Down

0 comments on commit a1a1217

Please sign in to comment.