Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Listing Bounties Shows Wrong BountyID. #153

Closed
shekohex opened this issue Aug 14, 2020 · 1 comment · Fixed by #154
Closed

Listing Bounties Shows Wrong BountyID. #153

shekohex opened this issue Aug 14, 2020 · 1 comment · Fixed by #154
Assignees
Labels
Bug A bug!

Comments

@shekohex
Copy link

shekohex commented Aug 14, 2020

What is wrong?

When I try to list open bounties using Sunshine CLI shows big ids that seem to be not correct.

For example, a BountyId that is 12116433537164092995!

Steps to Reproduce

  1. Using Sunshine CLI (the master branch)

  2. Run a Clean node.

$ cargo run --bin sunshine-node -- purge-chain --dev
  1. Run the Node in dev mode locally with RPC open.
$ cargo run --bin sunshine-node -- --dev --ws-external --rpc-cors all
  1. Run the CLI and Create your own Key.
$ cargo run --bin sunshine-cli -- key set
  1. Once you have an account created (and minted), List Open Bounties.
$ cargo run -q --bin sunshine-cli -- bounty get-open-bounties 0

you should see

No open bounties above the passed input minimum balance

since there is none, let's create one:

  1. Create a new Bounty
$ cargo run -q --bin sunshine-cli -- bounty post-bounty sunshine-protocol sunshine-bounty 108 1000

This will create a bounty for #108

Depositer with AccountId 5H8Wjs3WAiB1BYd1jwRHwkL7i8VPCpeRcwFM8kyaBe1Gvo6T posted new BountyId 1, Balance 1000

Notice the BountyID.

  1. List Open bounties again
$ cargo run -q --bin sunshine-cli -- bounty get-open-bounties 0

and you get a wrong IDs

Live BountyID 12116433537164092995 has total available balance 1000

BTW, if you created a new Bounty it will get a new ID of 2 but when you list bounties it will get the same long ID 12116433537164092995

@4meta5
Copy link
Collaborator

4meta5 commented Aug 14, 2020

Ok, I reproduced in client tests

client git:(fix-node-test-client) cart --release
   Compiling sunshine-bounty-client v0.2.0 (/Users/4meta5/sunshine-protocol/sunshine-node/client/client)
   Compiling test-client v0.1.0 (/Users/4meta5/sunshine-protocol/sunshine-node/bin/client)
    Finished release [optimized] target(s) in 45.74s
     Running /Users/4meta5/sunshine-protocol/sunshine-node/target/release/deps/sunshine_bounty_client-c6982707b32b4a11

running 5 tests
test org::tests::simple_test ... ok
test bounty::tests::simple_test ... ok
test bounty::tests::post_bounty_test ... ok
test org::tests::register_flat_org_test ... ok
test bounty::tests::get_bounties_test ... FAILED

failures:

---- bounty::tests::get_bounties_test stdout ----
thread 'bounty::tests::get_bounties_test' panicked at 'assertion failed: `(left == right)`
  left: `12116433537164092995`,
 right: `1`', client/client/src/bounty/mod.rs:268:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

4meta5 added a commit that referenced this issue Aug 14, 2020
@4meta5 4meta5 mentioned this issue Aug 14, 2020
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants