Skip to content

Commit

Permalink
PKG -- [fcl] Error on getInteractionTemplateAudits on mainnet until s…
Browse files Browse the repository at this point in the history
…upport is added (#1386)
  • Loading branch information
JeffreyDoyle authored Aug 30, 2022
1 parent 7ce51c4 commit 3fdcc3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-bobcats-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/fcl": patch
---

Remove support for InteractionTemplateUtils.getInteractionTemplateAudits on mainnet until support is added
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {query} from "../exec/query.js"
import {generateTemplateId} from "./generate-template-id.js"
import {normalizeInteractionTemplate} from "../normalizers/interaction-template/interaction-template.js"

export async function getInteractionTemplateAudits({template, auditors}) {
export async function getInteractionTemplateAudits(
{template, auditors},
opts = {}
) {
invariant(
template != undefined,
"getInteractionTemplateAudits({ template }) -- template must be defined"
Expand Down Expand Up @@ -55,17 +58,20 @@ export async function getInteractionTemplateAudits({template, auditors}) {
"getInteractionTemplateAudits Error: Unable to determine address for FlowInteractionTemplateAudit contract. Set configuration for 'fcl.network' to 'mainnet' or 'testnet'"
)
if (fclNetwork === "mainnet") {
FlowInteractionAuditContract = "0xb4b82a1c9d21d284"
FlowInteractionAuditContract = ""
throw new Error(
"getInteractionTemplateAudits Error: Not supported on MainNet in this release. MainNet support Coming Soon!"
)
} else {
FlowInteractionAuditContract = "0x74daa6f9c7ef24b1"
FlowInteractionAuditContract = "0xf78bfc12d0a786dc"
}
}

const audits = await query({
cadence: `
import FlowInteractionTemplateAudit from ${FlowInteractionAuditContract}
pub fun main(templateId: String, auditors: [Address]): {Address:Bool} {
return FlowInteractionAudit.getHasTemplateBeenAuditedByAuditors(templateId: templateId, auditors: auditors)
return FlowInteractionTemplateAudit.getHasTemplateBeenAuditedByAuditors(templateId: templateId, auditors: auditors)
}
`,
args: (arg, t) => [
Expand Down

0 comments on commit 3fdcc3b

Please sign in to comment.