-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Description
implment util function to generalise tx validation for header and footer (this last if tx is signed)
it should, at least contain:
- transaction type: must be
- not nil
- a valid tx type
- sender account type: must be
- not nil
- a valid account type
- sender account: must be a valid account
- not nil
- a valid account (validation depends on the account type):
- type 0: b64decode and check that is 32 bytes long
- recipient account: if present (depends on tx type), must be a valid account
- a valid account (validation depends on the account type):
- type 0: b64decode and check that is 32 bytes long
- a valid account (validation depends on the account type):
- fee: must be
- greater than 0 (beside if genesis block transaction?)
- transaction body length: must be
- not nil (?)
- greater than 0 (?)
- transaction body bytes: must be
- len(TransactionBodyBytes) == TransactionBodyLength
- transaction signature: if present, must be
- a valid signature (verify against account public key...)
Breakdown
- Implement new method in util package and add above tx validation rules
- call it at the beginning of every transaction Validate() implementation
- refactor VerifySignature method to use account public key instead of account ID (to be discussed)
Metadata
Metadata
Assignees
Labels
FEATURENew feature or requestNew feature or request