-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from DeAccountSystems/develop
feat: implement secondary market
- Loading branch information
Showing
86 changed files
with
6,744 additions
and
4,559 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "account-auction-cell-type" | ||
version = "1.0.0" | ||
edition = "2018" | ||
|
||
[features] | ||
dev = ["das-core/dev"] | ||
local = ["das-core/local"] | ||
testnet = ["das-core/testnet"] | ||
mainnet = ["das-core/mainnet"] | ||
|
||
[dependencies] | ||
ckb-std = "0.7.1" | ||
das-map = { path = "../../libs/das-map" } | ||
das-core = { path = "../../libs/das-core", default-features = false } | ||
das-types = { path = "../../../das-types/rust", default-features = false } | ||
chrono = { version = "0.4", default-features = false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use ckb_std::ckb_constants::Source; | ||
use das_core::{constants::*, debug, error::Error, util, witness_parser::WitnessesParser}; | ||
|
||
pub fn main() -> Result<(), Error> { | ||
debug!("====== Running account-auction-cell-type ======"); | ||
let mut parser = WitnessesParser::new()?; | ||
let action_opt = parser.parse_action_with_params()?; | ||
if action_opt.is_none() { | ||
return Err(Error::ActionNotSupported); | ||
} | ||
|
||
let (action_raw, _params_raw) = action_opt.unwrap(); | ||
let action = action_raw.as_reader().raw_data(); | ||
// let params = params_raw.iter().map(|param| param.as_reader()).collect::<Vec<_>>(); | ||
|
||
util::is_system_off(&mut parser)?; | ||
parser.parse_cell()?; | ||
|
||
if action == b"start_account_auction" | ||
|| action == b"edit_account_auction" | ||
|| action == b"cancel_account_auction" | ||
|| action == b"bid_account_auction" | ||
|| action == b"confirm_account_auction" | ||
{ | ||
// let timestamp = util::load_oracle_data(OracleCellType::Time)?; | ||
// let config_main_reader = parser.configs.main()?; | ||
// let config_secondary_market_reader = parser.configs.secondary_market()?; | ||
// let (input_auction_cell, output_auction_cell) = load_auction_cell()?; | ||
|
||
if action == b"start_account_auction" { | ||
debug!("Route to start_account_auction action ..."); | ||
} else if action == b"cancel_account_auction" { | ||
debug!("Route to cancel_account_auction action ..."); | ||
} else if action == b"bid_account_auction" { | ||
debug!("Route to bid_account_auction action ..."); | ||
} else if action == b"confirm_account_auction" { | ||
debug!("Route to confirm_account_auction action ..."); | ||
} | ||
} else if action == b"force_recover_account_status" { | ||
util::require_type_script( | ||
&mut parser, | ||
TypeScript::AccountCellType, | ||
Source::Input, | ||
Error::InvalidTransactionStructure, | ||
)?; | ||
} else { | ||
return Err(Error::ActionNotSupported); | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Generated by capsule | ||
//! | ||
//! `main.rs` is used to define rust lang items and modules. | ||
//! See `entry.rs` for the `main` function. | ||
//! See `error.rs` for the `Error` type. | ||
|
||
#![no_std] | ||
#![no_main] | ||
#![feature(lang_items)] | ||
#![feature(alloc_error_handler)] | ||
#![feature(panic_info_message)] | ||
|
||
// define modules | ||
mod entry; | ||
|
||
use ckb_std::default_alloc; | ||
|
||
ckb_std::entry!(program_entry); | ||
default_alloc!(); | ||
|
||
/// program entry | ||
fn program_entry() -> i8 { | ||
// Call main function and return error code | ||
match entry::main() { | ||
Ok(_) => 0, | ||
Err(err) => err as i8, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "account-cell-type" | ||
version = "1.2.1" | ||
version = "1.3.1" | ||
edition = "2018" | ||
|
||
[features] | ||
|
Oops, something went wrong.