Closed JunOkumura closed 5 years ago
Bitcoin::Wallet::Base Line 51: wallet_id = path.delete(path_prefix + '/wallet').delete("/").to_i It is failed when path_prefix include '-'.
wallet_id = path.delete(path_prefix + '/wallet').delete("/").to_i
irb(main):001:0>"/bitcoinrb-grpc/.bitcoinrb/regtest/db/wallet/wallet1/".delete("/bitcoinrb-grpc/.bitcoinrb/regtest/db/wallet/" + '/wallet').delete('/').to_i => -1
example: "/bitcoinrb-grpc/.bitcoinrb/regtest/db/wallet/wallet1/".delete("/bitcoinrb-grpc/.bitcoinrb/regtest/db/wallet/" + '/wallet').delete('/').to_i result: 1
result: -1 application failed.
That is wrong use to String#delete. String#delete can use range character.
irb(main):001:0> "12345".delete("1-3") => "45"
Bitcoin::Wallet::Base Line 51:
wallet_id = path.delete(path_prefix + '/wallet').delete("/").to_i
It is failed when path_prefix include '-'.Steps to Reproduce
Expect
example: "/bitcoinrb-grpc/.bitcoinrb/regtest/db/wallet/wallet1/".delete("/bitcoinrb-grpc/.bitcoinrb/regtest/db/wallet/" + '/wallet').delete('/').to_i result: 1
Actual
result: -1 application failed.
That is wrong use to String#delete. String#delete can use range character.