Skip to content

Commit

Permalink
Merge pull request #193 from make-software/bugfix/missing_cspr_transf…
Browse files Browse the repository at this point in the history
…er_event

Added back missing CSPRTransfer event to the schema
  • Loading branch information
kubaplas authored Nov 27, 2023
2 parents 29e071c + fbf3db1 commit f6aea33
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dao/src/bid_escrow/bid_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions dao/src/bid_escrow/job_engine.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions dao/src/onboarding/voting.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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<VotingId, Request>,
configurations: Mapping<VotingId, Configuration>,
Expand Down
42 changes: 42 additions & 0 deletions resources/bid_escrow_contract_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down
21 changes: 21 additions & 0 deletions resources/onboarding_request_contract_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit f6aea33

Please sign in to comment.