diff --git a/ex/.gitignore b/ex/.gitignore index 3bfe9e6..b3171ea 100644 --- a/ex/.gitignore +++ b/ex/.gitignore @@ -1,3 +1,6 @@ _build/ deps/ +target/ priv/index.html +priv/native/*.so +amadeusd diff --git a/ex/lib/consensus/models/entry_genesis.ex b/ex/lib/consensus/models/entry_genesis.ex index c46c8fc..a675952 100644 --- a/ex/lib/consensus/models/entry_genesis.ex +++ b/ex/lib/consensus/models/entry_genesis.ex @@ -182,7 +182,7 @@ defmodule EntryGenesis do pop = BlsEx.sign!(sk, pk, BLS12AggSig.dst_pop()) DB.Entry.insert(entry_signed, %{rtx: rtx}) - DB.Entry.apply_into_main_chain(entry_signed, mutations_hash, [], [], "", "", %{rtx: rtx}) + DB.Entry.apply_into_main_chain(entry_signed, mutations_hash, [], {[], []}, "", "", %{rtx: rtx}) RocksDB.put("temporal_tip", entry_signed.hash, %{rtx: rtx, cf: cf.sysconf}) RocksDB.put("rooted_tip", entry_signed.hash, %{rtx: rtx, cf: cf.sysconf}) diff --git a/ex/native/rdb/src/consensus/bic/lockup.rs b/ex/native/rdb/src/consensus/bic/lockup.rs index 22a760f..ef59477 100644 --- a/ex/native/rdb/src/consensus/bic/lockup.rs +++ b/ex/native/rdb/src/consensus/bic/lockup.rs @@ -51,13 +51,13 @@ pub fn call_unlock(env: &mut crate::consensus::consensus_apply::ApplyEnv, args: let unlock_height = vault_parts[0].as_slice(); let unlock_height = std::str::from_utf8(&unlock_height).ok().and_then(|s| s.parse::().ok()).unwrap_or_else(|| panic_any("invalid_unlock_height")); let amount = vault_parts[1].as_slice(); - let amount = std::str::from_utf8(&amount).ok().and_then(|s| s.parse::().ok()).unwrap_or_else(|| panic_any("invalid_unlock_amount")); + let amount = std::str::from_utf8(&amount).ok().and_then(|s| s.parse::().ok()).unwrap_or_else(|| panic_any("invalid_unlock_amount")); let symbol = vault_parts[2].as_slice(); if env.caller_env.entry_height < unlock_height { panic_any("vault_is_locked") } else { - kv_increment(env, &bcat(&[b"account:", &env.caller_env.account_caller, b":balance:", symbol]), amount as i128); + kv_increment(env, &bcat(&[b"account:", &env.caller_env.account_caller, b":balance:", symbol]), amount); kv_delete(env, vault_key); } } diff --git a/ex/native/rdb/src/consensus/consensus_apply.rs b/ex/native/rdb/src/consensus/consensus_apply.rs index 95308a0..88824c4 100644 --- a/ex/native/rdb/src/consensus/consensus_apply.rs +++ b/ex/native/rdb/src/consensus/consensus_apply.rs @@ -768,6 +768,14 @@ pub fn call_bic(env: &mut ApplyEnv, contract: Vec, function: Vec, args: (b"Coin", b"transfer") => consensus::bic::coin::call_transfer(env, args), + (b"Lockup", b"lock") => consensus::bic::lockup::call_lock(env, args), + (b"Lockup", b"unlock") => consensus::bic::lockup::call_unlock(env, args), + + (b"LockupPrime", b"lock") => consensus::bic::lockup_prime::call_lock(env, args), + (b"LockupPrime", b"unlock") => consensus::bic::lockup_prime::call_unlock(env, args), + (b"LockupPrime", b"daily_checkin") => consensus::bic::lockup_prime::call_daily_checkin(env, args), + _ => std::panic::panic_any("invalid_bic_action") + /* (b"Coin", b"create_and_mint") => consensus::bic::coin::call_create_and_mint(env, args), (b"Coin", b"mint") => consensus::bic::coin::call_mint(env, args), @@ -775,18 +783,11 @@ pub fn call_bic(env: &mut ApplyEnv, contract: Vec, function: Vec, args: (b"Nft", b"transfer") => consensus::bic::nft::call_transfer(env, args), (b"Nft", b"create_collection") => consensus::bic::nft::call_create_collection(env, args), (b"Nft", b"mint") => consensus::bic::nft::call_mint(env, args), - (b"Lockup", b"lock") => consensus::bic::lockup::call_lock(env, args), - (b"Lockup", b"unlock") => consensus::bic::lockup::call_unlock(env, args), (b"Contract", b"deploy") => { consensus_kv::exec_budget_decr(env, protocol::COST_PER_DEPLOY); consensus::bic::contract::call_deploy(env, args) }, - (b"LockupPrime", b"lock") => consensus::bic::lockup_prime::call_lock(env, args), - (b"LockupPrime", b"unlock") => consensus::bic::lockup_prime::call_unlock(env, args), - (b"LockupPrime", b"daily_checkin") => consensus::bic::lockup_prime::call_daily_checkin(env, args), - */ - - _ => std::panic::panic_any("invalid_bic_action") + */ } }