From fbf3db1528db9a3a9e27260269e041f9d72bb687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20P=C5=82askonka?= Date: Fri, 10 Nov 2023 14:56:52 +0100 Subject: [PATCH] Added back missing CSPRTransfer event to the schema --- dao/src/bid_escrow/bid_engine.rs | 4 +- dao/src/bid_escrow/job_engine.rs | 5 ++- dao/src/onboarding/voting.rs | 4 +- resources/bid_escrow_contract_schema.json | 42 +++++++++++++++++++ .../onboarding_request_contract_schema.json | 21 ++++++++++ 5 files changed, 70 insertions(+), 6 deletions(-) diff --git a/dao/src/bid_escrow/bid_engine.rs b/dao/src/bid_escrow/bid_engine.rs index 9f5e28e2..4b2e03ae 100644 --- a/dao/src/bid_escrow/bid_engine.rs +++ b/dao/src/bid_escrow/bid_engine.rs @@ -5,7 +5,7 @@ extern crate alloc; use crate::bid_escrow::bid::{Bid, BidStatus, CancelBidRequest, SubmitBidRequest}; use crate::bid_escrow::events::{ - BidCancelled, BidSubmitted, JobCreated, JobOfferCreated, TransferReason, + BidCancelled, BidSubmitted, CSPRTransfer, JobCreated, JobOfferCreated, TransferReason, }; use crate::bid_escrow::job::{Job, PickBidRequest}; use crate::bid_escrow::job_offer::{CancelJobOfferRequest, JobOffer, PostJobOfferRequest}; @@ -20,7 +20,7 @@ use odra::prelude::{vec, vec::Vec}; use odra::types::{event::OdraEvent, Address, Balance, BlockTime}; /// Manages the Bidding process. -#[odra::module(events = [JobCreated, JobOfferCreated, BidSubmitted, BidCancelled])] +#[odra::module(events = [JobCreated, JobOfferCreated, BidSubmitted, BidCancelled, CSPRTransfer])] pub struct BidEngine { bid_storage: BidStorage, job_storage: JobStorage, diff --git a/dao/src/bid_escrow/job_engine.rs b/dao/src/bid_escrow/job_engine.rs index 5b6b1f60..d606d605 100644 --- a/dao/src/bid_escrow/job_engine.rs +++ b/dao/src/bid_escrow/job_engine.rs @@ -1,7 +1,8 @@ //! Job Engine module. use crate::bid_escrow::bid::{Bid, ReclaimBidRequest}; use crate::bid_escrow::events::{ - BidEscrowVotingCreated, JobCancelled, JobDone, JobRejected, JobSubmitted, TransferReason, + BidEscrowVotingCreated, CSPRTransfer, JobCancelled, JobDone, JobRejected, JobSubmitted, + TransferReason, }; use crate::bid_escrow::job::{Job, ReclaimJobRequest, SubmitJobProofRequest, WorkerType}; use crate::bid_escrow::storage::{BidStorage, JobStorage}; @@ -24,7 +25,7 @@ use odra::types::{event::OdraEvent, Balance}; use odra::UnwrapOrRevert; /// Manages Jobs lifecycle. -#[odra::module(events = [JobSubmitted, JobRejected, JobCancelled, JobDone, BidEscrowVotingCreated])] +#[odra::module(events = [JobSubmitted, JobRejected, JobCancelled, JobDone, BidEscrowVotingCreated, CSPRTransfer])] pub struct JobEngine { job_storage: JobStorage, bid_storage: BidStorage, diff --git a/dao/src/onboarding/voting.rs b/dao/src/onboarding/voting.rs index 604911e4..4925a023 100644 --- a/dao/src/onboarding/voting.rs +++ b/dao/src/onboarding/voting.rs @@ -1,6 +1,6 @@ //! Voting module for onboarding requests. -use crate::bid_escrow::events::TransferReason; +use crate::bid_escrow::events::{CSPRTransfer, TransferReason}; use crate::configuration::{Configuration, ConfigurationBuilder}; use crate::modules::refs::ContractRefs; use crate::onboarding::request::{OnboardingRequest, Request}; @@ -21,7 +21,7 @@ use odra::types::{Address, Balance}; use odra::{Mapping, UnwrapOrRevert}; /// Onboarding voting module. -#[odra::module] +#[odra::module(events = [CSPRTransfer])] pub struct Onboarding { requests: Mapping, configurations: Mapping, diff --git a/resources/bid_escrow_contract_schema.json b/resources/bid_escrow_contract_schema.json index 1c7d02a5..80bfd603 100644 --- a/resources/bid_escrow_contract_schema.json +++ b/resources/bid_escrow_contract_schema.json @@ -567,6 +567,27 @@ } ] }, + { + "name": "CSPRTransfer", + "fields": [ + { + "name": "from", + "ty": "Key" + }, + { + "name": "to", + "ty": "Key" + }, + { + "name": "amount", + "ty": "U512" + }, + { + "name": "reason", + "ty": "String" + } + ] + }, { "name": "VotingCreatedInfo", "fields": [ @@ -895,6 +916,27 @@ } ] }, + { + "name": "CSPRTransfer", + "fields": [ + { + "name": "from", + "ty": "Key" + }, + { + "name": "to", + "ty": "Key" + }, + { + "name": "amount", + "ty": "U512" + }, + { + "name": "reason", + "ty": "String" + } + ] + }, { "name": "VotingCreatedInfo", "fields": [ diff --git a/resources/onboarding_request_contract_schema.json b/resources/onboarding_request_contract_schema.json index 8c9a0d0a..99642349 100644 --- a/resources/onboarding_request_contract_schema.json +++ b/resources/onboarding_request_contract_schema.json @@ -505,6 +505,27 @@ } ] }, + { + "name": "CSPRTransfer", + "fields": [ + { + "name": "from", + "ty": "Key" + }, + { + "name": "to", + "ty": "Key" + }, + { + "name": "amount", + "ty": "U512" + }, + { + "name": "reason", + "ty": "String" + } + ] + }, { "name": "VotingCreatedInfo", "fields": [