How to use the @chainlink/test-helpers.coordinator function in @chainlink/test-helpers

To help you get started, we’ve selected a few @chainlink/test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smartcontractkit / chainlink / integration-scripts / src / initiateServiceAgreement.ts View on Github external
requestDigest: ethers.utils.keccak256(
      ethers.utils.toUtf8Bytes(normalizedRequest),
    ),
  }

  const sig = ethers.utils.splitSignature(oracleSignature)
  if (!sig.v) {
    throw Error(`Could not extract v from signature`)
  }

  const oracleSignatures: OracleSignatures = {
    vs: [sig.v],
    rs: [sig.r],
    ss: [sig.s],
  }
  const encodedSignatures = t.coordinator.encodeOracleSignatures(
    oracleSignatures,
  )

  const said = t.coordinator.generateSAID(sa)
  const encodedSA = t.coordinator.encodeServiceAgreement(sa)
  const ssaid = await coordinator.getId(encodedSA)
  if (said != ssaid) {
    throw Error(`sAId mismatch. javascript: ${said} solidity: ${ssaid}`)
  }

  console.log('Initiating service agreement...')
  const recoveredAddresss = ethers.utils.recoverAddress(said, sig)

  console.log({
    recoveredAddresss,
    expectedAddress,
github smartcontractkit / chainlink / integration-scripts / src / initiateServiceAgreement.ts View on Github external
const sig = ethers.utils.splitSignature(oracleSignature)
  if (!sig.v) {
    throw Error(`Could not extract v from signature`)
  }

  const oracleSignatures: OracleSignatures = {
    vs: [sig.v],
    rs: [sig.r],
    ss: [sig.s],
  }
  const encodedSignatures = t.coordinator.encodeOracleSignatures(
    oracleSignatures,
  )

  const said = t.coordinator.generateSAID(sa)
  const encodedSA = t.coordinator.encodeServiceAgreement(sa)
  const ssaid = await coordinator.getId(encodedSA)
  if (said != ssaid) {
    throw Error(`sAId mismatch. javascript: ${said} solidity: ${ssaid}`)
  }

  console.log('Initiating service agreement...')
  const recoveredAddresss = ethers.utils.recoverAddress(said, sig)

  console.log({
    recoveredAddresss,
    expectedAddress,
    oracleSignature,
    ...sig,
  })

  const tx = await coordinator.initiateServiceAgreement(
github smartcontractkit / chainlink / integration-scripts / src / initiateServiceAgreement.ts View on Github external
const sig = ethers.utils.splitSignature(oracleSignature)
  if (!sig.v) {
    throw Error(`Could not extract v from signature`)
  }

  const oracleSignatures: OracleSignatures = {
    vs: [sig.v],
    rs: [sig.r],
    ss: [sig.s],
  }
  const encodedSignatures = t.coordinator.encodeOracleSignatures(
    oracleSignatures,
  )

  const said = t.coordinator.generateSAID(sa)
  const encodedSA = t.coordinator.encodeServiceAgreement(sa)
  const ssaid = await coordinator.getId(encodedSA)
  if (said != ssaid) {
    throw Error(`sAId mismatch. javascript: ${said} solidity: ${ssaid}`)
  }

  console.log('Initiating service agreement...')
  const recoveredAddresss = ethers.utils.recoverAddress(said, sig)

  console.log({
    recoveredAddresss,
    expectedAddress,
    oracleSignature,
    ...sig,
  })

@chainlink/test-helpers

A collection of test helpers to facilitate testing chainlink's smart contracts

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis

Similar packages