Skip to content

Commit

Permalink
Updated Playground
Browse files Browse the repository at this point in the history
  • Loading branch information
quent043 committed Dec 1, 2023
1 parent be86269 commit fcd1153
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion scripts/playground/2-create-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getSignatureForService } from '../../test/utils/signature'
import hre = require('hardhat')

const aliceTlId = 1
const referralAmount = 0

/*
In this script Alice will create two services.
Expand Down Expand Up @@ -56,7 +57,7 @@ async function main() {

const createFirstOpenService = await talentLayerService
.connect(alice)
.createService(aliceTlId, daveTalentLayerIdPlatform, aliceCreateFirstJobData, signatureFirstJob)
.createService(aliceTlId, daveTalentLayerIdPlatform, aliceCreateFirstJobData, signatureFirstJob, ethers.constants.AddressZero, referralAmount)
await createFirstOpenService.wait()
console.log('First Open Service created')

Expand Down Expand Up @@ -91,6 +92,8 @@ async function main() {
daveTalentLayerIdPlatform,
aliceCreateSecondJobData,
signatureSecondJob,
ethers.constants.AddressZero,
referralAmount,
)
await createSecondOpenService.wait()
console.log('Open Service 2 created')
Expand Down
3 changes: 2 additions & 1 deletion scripts/playground/2-update-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import postToIPFS from '../utils/ipfs'
import hre = require('hardhat')

const aliceTlId = 1
const referralAmount = 0

/*
In this script Alice will update the first service.
Expand Down Expand Up @@ -49,7 +50,7 @@ async function main() {

await talentLayerService
.connect(alice)
.updateServiceData(aliceTlId, firstServiceId, aliceUpdateJobData)
.updateService(aliceTlId, firstServiceId, ethers.constants.AddressZero, referralAmount, aliceUpdateJobData)
const jobDataAfterUpdate = await talentLayerService.getService(firstServiceId)
console.log('Job Data after update', jobDataAfterUpdate)
}
Expand Down
7 changes: 4 additions & 3 deletions scripts/playground/3-make-proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const aliceTlId = 1
const bobTlId = 2
const carolTlId = 3
const daveTlId = 4
const referrerTlId = 0

const minTokenWhitelistTransactionAmount = ethers.utils.parseUnits('0.0001', 18)

Expand Down Expand Up @@ -101,12 +102,12 @@ async function main() {
.createProposal(
bobTlId,
firstServiceId,
rateTokenBob,
ethers.utils.parseUnits('0.001', 18),
davePlatformId,
bobUri,
proposalExpirationDate,
signatureBobProposal,
referrerTlId,
)
console.log('Bob proposal created')
await bobProposal.wait()
Expand All @@ -124,12 +125,12 @@ async function main() {
.createProposal(
carolTlId,
firstServiceId,
rateTokenCarol,
ethers.utils.parseUnits('0.002', 18),
bobPlatformId,
carolUri,
proposalExpirationDate,
signatureCarolProposal,
referrerTlId,
)
console.log('Carol proposal created')
await carolProposal.wait()
Expand All @@ -147,12 +148,12 @@ async function main() {
.createProposal(
daveTlId,
secondServiceId,
rateTokenDave,
ethers.utils.parseUnits('0.003', 18),
bobPlatformId,
daveUri,
proposalExpirationDate,
signatureDaveProposal,
referrerTlId,
)
console.log('Dave proposal created')
await daveProposal.wait()
Expand Down
3 changes: 2 additions & 1 deletion scripts/playground/4-update-proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import postToIPFS from '../utils/ipfs'
import hre = require('hardhat')

const bobTlId = 2
const referrerTlId = 0
const now = Math.floor(Date.now() / 1000)
const proposalExpirationDate = now + 60 * 60 * 24 * 30

Expand Down Expand Up @@ -41,10 +42,10 @@ async function main() {
.updateProposal(
bobTlId,
firstServiceId,
rateTokenBob,
ethers.utils.parseUnits('0.0015', 18),
bobUri,
proposalExpirationDate,
referrerTlId,
)

console.log('Bob update his proposal')
Expand Down
2 changes: 1 addition & 1 deletion scripts/playground/8-reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function main() {

const talentLayerReview = await ethers.getContractAt(
'TalentLayerReview',
getDeploymentProperty(network, DeploymentProperty.Reviewscontract),
getDeploymentProperty(network, DeploymentProperty.TalentLayerReview),
)

const aliceReviewCarol = await postToIPFS(
Expand Down

0 comments on commit fcd1153

Please sign in to comment.