Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update transaction schema #7381

Closed
Tracked by #7211
shuse2 opened this issue Aug 9, 2022 · 0 comments · Fixed by #7410
Closed
Tracked by #7211

Update transaction schema #7381

shuse2 opened this issue Aug 9, 2022 · 0 comments · Fixed by #7410

Comments

@shuse2
Copy link
Collaborator

shuse2 commented Aug 9, 2022

Description

Update transaction schema to be

transactionSchema = {
    "type": "object",
    "required": [
        "module",
        "command",
        "nonce",
        "fee",
        "senderPublicKey",
        "params",
        "signatures"
    ],
    "properties": {
        "module": {
            "dataType": "string",
            "minLength": MIN_MODULE_NAME_LENGTH,
            "maxLength": MAX_MODULE_NAME_LENGTH,
            "fieldNumber": 1
        },
        "command": {
            "dataType": "string",
            "minLength": MIN_COMMAND_NAME_LENGTH,
            "maxLength": MAX_COMMAND_NAME_LENGTH,
            "fieldNumber": 2
        },
        "nonce": {
            "dataType": "uint64",
            "fieldNumber": 3
        },
        "fee": {
            "dataType": "uint64",
            "fieldNumber": 4
        },
        "senderPublicKey": {
            "dataType": "bytes",
            "length": ED25519_PUBLIC_KEY_LENGTH,
            "fieldNumber": 5
        },
        "params": {
            "dataType": "bytes",
            "fieldNumber": 6
        },
        "signatures": {
            "dataType": "array",
            "items": {
                "dataType": "bytes",
                "length": ED25519_SIGNATURE_LENGTH
            },
            "fieldNumber": 7
        }
    }
}

  • Update validate function to follow
    • trs.params is of length less than or equal to MAX_PARAMS_SIZE.
    • trs.module is an alphanumeric string, i.e., matches the regular expression "^[a-zA-Z0-9]*$".
    • trs.command is an alphanumeric string, i.e., matches the regular expression "^[a-zA-Z0-9]*$".
  • Update routing of command in state machine to use module.name and command.name
  • Update ABI schema and interface to use above transaction
  • Remove id from BaseCommand and Metadata.commands in base_command.ts/base_module.ts
  • Remove id from ModuleMetadataJSON in base_module.ts

Acceptance Criteria

  • Ensure dpos-mainchain runs and accept transfer transaction and process them
  • All build and test should pass

Additional Information

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants