Check account API
This commit is contained in:
parent
2940d8f8da
commit
56b8113084
|
@ -273,6 +273,8 @@ void truncate_data(void);
|
|||
|
||||
void truncate_sync_data(void);
|
||||
|
||||
bool check_account(uint8_t coin, uint32_t account);
|
||||
|
||||
void delete_account(uint8_t coin, uint32_t account);
|
||||
|
||||
struct CResult_____c_char make_payment_uri(uint8_t coin,
|
||||
|
|
|
@ -25,6 +25,12 @@ use zcash_client_backend::keys::UnifiedFullViewingKey;
|
|||
use zcash_primitives::consensus::Parameters;
|
||||
use zcash_primitives::zip32::DiversifierIndex;
|
||||
|
||||
pub fn check_account(coin: u8, account: u32) -> bool {
|
||||
let c = CoinConfig::get(coin);
|
||||
let db = c.db().unwrap();
|
||||
db.get_account_info(account).is_ok()
|
||||
}
|
||||
|
||||
/// Create a new account
|
||||
/// # Arguments
|
||||
///
|
||||
|
|
|
@ -683,6 +683,11 @@ pub unsafe extern "C" fn truncate_sync_data() {
|
|||
log_error(res)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn check_account(coin: u8, account: u32) -> bool {
|
||||
crate::api::account::check_account(coin, account)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn delete_account(coin: u8, account: u32) {
|
||||
let res = crate::api::account::delete_account(coin, account);
|
||||
|
|
Loading…
Reference in New Issue