Skip to content

Commit

Permalink
Fixup rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Dec 29, 2021
1 parent f288dce commit 998d1a9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
5 changes: 0 additions & 5 deletions crates/phactory/src/contracts/btc_price_bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ impl contracts::NativeContract for BtcPriceBot {
type QReq = Request;
type QResp = Result<Response, Error>;

/// Return the contract id which uniquely identifies the contract
fn id(&self) -> contracts::ContractId {
contracts::id256(contracts::BTC_PRICE_BOT)
}

/// Handle the Commands from transactions on the blockchain. This method doesn't respond.
fn handle_command(
&mut self,
Expand Down
5 changes: 0 additions & 5 deletions crates/phactory/src/contracts/guess_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ impl contracts::NativeContract for GuessNumber {
type QReq = Request;
type QResp = Result<Response, Error>;

/// Return the contract id which uniquely identifies the contract
fn id(&self) -> contracts::ContractId {
contracts::id256(contracts::GUESS_NUMBER)
}

/// Handle the Commands from transactions on the blockchain. This method doesn't respond.
///
/// # Arguments
Expand Down
5 changes: 3 additions & 2 deletions crates/phactory/src/contracts/support/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ use std::ops::{Deref, DerefMut};

use super::{Contract, NativeCompatContract, NativeContractWrapper};
use crate::contracts::{
assets::Assets, balances::Balances, btc_lottery::BtcLottery, data_plaza::DataPlaza,
geolocation::Geolocation, pink::Pink, web3analytics::Web3Analytics,
assets::Assets, balances::Balances, btc_lottery::BtcLottery, btc_price_bot::BtcPriceBot,
data_plaza::DataPlaza, geolocation::Geolocation, guess_number::GuessNumber, pink::Pink,
web3analytics::Web3Analytics,
};

type ContractMap = BTreeMap<ContractId, AnyContract>;
Expand Down
4 changes: 3 additions & 1 deletion crates/phactory/src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,9 @@ impl<Platform: pal::Platform> System<Platform> {
(ASSETS => assets::Assets::new()),
(BTC_LOTTERY => btc_lottery::BtcLottery::new(Some(contract_key.0.to_raw_vec()))),
(WEB3_ANALYTICS => web3analytics::Web3Analytics::new()),
(GEOLOCATION => geolocation::Geolocation::new())
(GEOLOCATION => geolocation::Geolocation::new()),
(GUESS_NUMBER => guess_number::GuessNumber::new()),
(BTC_PRICE_BOT => btc_price_bot::BtcPriceBot::new())
};

self.contract_groups
Expand Down
2 changes: 0 additions & 2 deletions crates/phala-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ pub mod messaging {
}

// Bind on-chain GuessNumberCommand message to the GUESS_NUMBER contract
bind_contract32!(GuessNumberCommand, contract::GUESS_NUMBER);
#[derive(Debug, Clone, Encode, Decode)]
pub enum GuessNumberCommand {
/// Refresh the random number
Expand All @@ -240,7 +239,6 @@ pub mod messaging {
SetOwner { owner: AccountId },
}

bind_contract32!(BtcPriceBotCommand, contract::BTC_PRICE_BOT);
#[derive(Debug, Clone, Encode, Decode)]
pub enum BtcPriceBotCommand {
/// Set the contract owner
Expand Down

0 comments on commit 998d1a9

Please sign in to comment.