nervosnetwork / capsule

Capsule is an out-of-box development framework for creating smart contract on Nervos' CKB.
MIT License
60 stars 34 forks source link

Deploy errors out on capacity parsing #131

Closed phroi closed 8 months ago

phroi commented 11 months ago

Describe the bug

Running capsule deploy:

capsule deploy --address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqwgx292hnvmn68xf779vmzrshpmm6epn4c0cgwga

Returns the following error message:

thread 'main' panicked at 'parse capacity: "decimal part too long: 14"', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ckb-capsule-0.10.1/src/wallet/cli_types/live_cell_info.rs:48:14

Additional context

$ RUST_BACKTRACE=1 RUST_LOG=capsule=trace capsule deploy --address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqwgx292hnvmn68xf779vmzrshpmm6epn4c0cgwga
thread 'main' panicked at 'parse capacity: "decimal part too long: 14"', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ckb-capsule-0.10.1/src/wallet/cli_types/live_cell_info.rs:48:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/result.rs:1651:5
   3: ckb_capsule::wallet::cli_types::live_cell_info::<impl core::convert::From<ckb_capsule::wallet::cli_types::live_cell_info::LiveCellInfo> for ckb_capsule::wallet::cli_types::live_cell::LiveCell>::from
   4: ckb_capsule::wallet::collector::Collector::collect_live_cells
   5: ckb_capsule::wallet::wallet::Wallet::collect_live_cells
   6: ckb_capsule::wallet::wallet::Wallet::complete_tx_inputs
   7: ckb_capsule::deployment::deployment_process::DeploymentProcess::build_recipe
   8: ckb_capsule::deployment::deployment_process::DeploymentProcess::prepare_recipe
   9: ckb_capsule::deployment::manage::Manage::deploy
  10: capsule::run_cli
  11: capsule::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Keep up the great work :muscle: Phroi

doitian commented 8 months ago

ckb-cli returns capacity as a string like this:

300000.0 (CKB)
blckngm commented 8 months ago

Capsule deploy is no longer actively maintained and may not work with later versions of ckb-cli. You can use ckb-cli deploy or other options.

phroi commented 8 months ago

@doitian then we both agree capacity is an integer, just tell that to the capsule deploy command!! :wink:

Gotcha @blckngm, for now I developed an iCKB's deployer that also does a couple more things. It also helps me debugging changes to the underlying iCKB's Lumos Utils library.

Apart from #139, also feel free to update the relevant documentation: https://docs.nervos.org/docs/labs/sudtbycapsule/#deploy