Skip to content

TOK-455#327

Merged
cam-parra merged 6 commits intosovrin-foundation:masterfrom
mattraffel:master
Oct 23, 2018
Merged

TOK-455#327
cam-parra merged 6 commits intosovrin-foundation:masterfrom
mattraffel:master

Conversation

@mattraffel
Copy link
Copy Markdown
Contributor

Cases to test

  1. input hasn't been set totally
  2. inexistent payment-source
  3. insufficient funds
  4. extra funds

matt raffel added 2 commits October 22, 2018 13:56
Signed-off-by: matt raffel <matt.raffel@evernym.com>
Signed-off-by: matt raffel <matt.raffel@evernym.com>
cam-parra
cam-parra previously approved these changes Oct 23, 2018
Copy link
Copy Markdown
Contributor

@dastardlychimp dastardlychimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like changes to use the setup minting.

num_addresses: 2,
mint_tokens: vec![30, 50],

The tokens are mapped with the generated addresses.

let tokens : i32 = 50;

// ---- create some tokens
do_minting(pool_handle, &wallet, &dids, &payment_addresses[0], tokens);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do minting as part of the Setup/SetupConfig, so you don't need to have this do_minting function.


match indy::payments::Payment::build_payment_req(wallet.handle, Some(dids[0]), &pay_input_json, &pay_output_json, None) {
Ok(_) => { assert!(false, "Expected CommonInvalidStructure error"); }
Err(ec) => { assert_eq!(ec, ErrorCode::CommonInvalidStructure); }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use an assert_eq! assertion which is a little more condensed.

let ec = (...).unwrap_err();
assert_eq!(ErrorCode::CommonInvalidStructure, ec);

or

assert_eq!(Err(ErrorCode::CommonInvalidStructure), result);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better. thnx

Signed-off-by: matt raffel <matt.raffel@evernym.com>
matt raffel added 2 commits October 23, 2018 13:14
… functionality

Signed-off-by: matt raffel <matt.raffel@evernym.com>
Signed-off-by: matt raffel <matt.raffel@evernym.com>
dastardlychimp
dastardlychimp previously approved these changes Oct 23, 2018
Signed-off-by: matt raffel <matt.raffel@evernym.com>
@cam-parra cam-parra merged commit ea993b1 into sovrin-foundation:master Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants