8000 Handle transaction dry-run results · Issue #1578 · LiskHQ/lisk-mobile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle transaction dry-run results #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #1368
clemente-xyz opened this issue Jan 4, 2023 · 1 comment
Closed
Tracked by #1368

Handle transaction dry-run results #1578

clemente-xyz opened this issue Jan 4, 2023 · 1 comment

Comments

@clemente-xyz
Copy link
Member
clemente-xyz commented Jan 4, 2023

Expected behavior

According to https://github.com/LiskHQ/discussions/discussions/72, the POST /transactions/dryrun endpoint can result in 3 possible scenarios:

enum {
  INVALID = -1,
  FAIL = 0,
  OK = 1,
}

For result === -1 or result === 0, the user should be able to read a proper description of the failure of the transaction dry-run, and be able to react with clear actions over it.

Actual behavior

Our current implementation renders a global error screen, and also calculates de error message concatenating the data.events from the results, which is cryptic for the user.

Steps to reproduce

  1. Login to an account.
  2. Click on "Send Token" button on the home tab screen.
  3. Fill the form and make sure to select an account already created and with no balance as recipient address (so the dry-run fails).
  4. Enter password and submit the send token form.

Which version(s) does this affect? (Environment, OS, etc...)

All.

Additional information

  1. Token Module
const enum TokenEventResult {
	SUCCESSFUL = 0,
	FAIL_INSUFFICIENT_BALANCE = 1,
	DATA_TOO_LONG = 2,
	INVALID_TOKEN_ID = 3,
	TOKEN_NOT_SUPPORTED = 4,
	INSUFFICIENT_LOCKED_AMOUNT = 5,
	RECOVER_FAIL_INVALID_INPUTS = 6,
	RECOVER_FAIL_INSUFFICIENT_ESCROW = 7,
	MINT_FAIL_NON_NATIVE_TOKEN = 8,
	MINT_FAIL_TOTAL_SUPPLY_TOO_BIG = 9,
	MINT_FAIL_TOKEN_NOT_INITIALIZED = 10,
	TOKEN_ID_NOT_AVAILABLE = 11,
	TOKEN_ID_NOT_NATIVE = 12,
	INSUFFICIENT_ESCROW_BALANCE = 13,
}
  1. Fee Module
InsufficientFeeEvent
  1. Auth Module
InvalidSignatureEventData {
	numberOfSignatures: number;
	mandatoryKeys: Buffer[];
	optionalKeys: Buffer[];
	failingPublicKey: Buffer;
	failingSignature: Buffer;
}
  1. PoS Module
{
	STAKE_SUCCESSFUL = 0,
	STAKE_FAILED_NON_REGISTERED_VALIDATOR = 1,
	STAKE_FAILED_INVALID_UNSTAKE_PARAMETERS = 2,
	STAKE_FAILED_TOO_MANY_PENDING_UNLOCKS = 3,
	STAKE_FAILED_TOO_MANY_SENT_STAKES = 4,
}
const enum KeyRegResult {
	SUCCESS = 0,
	NO_VALIDATOR = 1,
	ALREADY_VALIDATOR = 2,
	DUPLICATE_BLS_KEY = 3,
	INVALID_POP = 4,
}
  1. Legacy Module
    None
@clemente-xyz clemente-xyz self-assigned this Jan 4, 2023
@ManuGowda ManuGowda changed the title Handle properly Dry-run Transaction possible results for UI Handle transaction dry-run results Jan 29, 2023
@sridharmeganathan sridharmeganathan added this to the Sprint 57 milestone Feb 13, 2023
@sridharmeganathan sridharmeganathan removed this from the Sprint 57 milestone Feb 27, 2023
@clemente-xyz
Copy link
Member Author

The error message calculation fix was done already on this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants
0