Skip to content
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

docs: create commonTransactionParameters to hold parameters that are common between all transaction types #209

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 33 additions & 28 deletions test-specifications/crypto-service/accountCreateTransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api

### Input Parameters

| Parameter Name | Type | Required/Optional | Description/Notes |
|---------------------------|--------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| key | string | optional | DER-encoded hex string representation for private or public keys. Keylists and threshold keys are the hex of the serialized protobuf bytes. |
| initialBalance | int64 | optional | Units of tinybars |
| receiverSignatureRequired | bool | optional | |
| autoRenewPeriod | int64 | optional | Units of seconds |
| memo | string | optional | |
| maxAutoTokenAssociations | int32 | optional | |
| stakedAccountId | string | optional | |
| stakedNodeId | int64 | optional | |
| declineStakingReward | bool | optional | |
| alias | string | optional | Hex string representation of the keccak-256 hash of an ECDSAsecp256k1 public key type. |
| signerKey | string | optional | DER-encoded hex string representation of an additional private key required to sign. |
| Parameter Name | Type | Required/Optional | Description/Notes |
|---------------------------|--------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| key | string | optional | DER-encoded hex string representation for private or public keys. Keylists and threshold keys are the hex of the serialized protobuf bytes. |
| initialBalance | int64 | optional | Units of tinybars |
| receiverSignatureRequired | bool | optional | |
| autoRenewPeriod | int64 | optional | Units of seconds |
| memo | string | optional | |
| maxAutoTokenAssociations | int32 | optional | |
| stakedAccountId | string | optional | |
| stakedNodeId | int64 | optional | |
| declineStakingReward | bool | optional | |
| alias | string | optional | Hex string representation of the keccak-256 hash of an ECDSAsecp256k1 public key type. |
| signerKeys | list<string> | optional | List of DER-encoded hex strings of all additional private keys required to sign. |

### Output Parameters

Expand Down Expand Up @@ -136,11 +136,11 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api

- If true, this account's key must sign any transaction depositing into this account (in addition to all withdrawals).

| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|--------------------------------------------------------------------------------------------|----------------------------------------------------------|--------------------------------------------------------------------------------------|-------------------|
| 1 | Creates an account that requires a receiving signature | key=<VALID_PRIVATE_KEY>, receiverSignatureRequired=true | The account creation succeeds and the account requires a receiving signature. | N |
| 2 | Creates an account that doesn't require a receiving signature | key=<VALID_PRIVATE_KEY>, receiverSignatureRequired=false | The account creation succeeds and the account doesn't require a receiving signature. | N |
| 3 | Creates an account that requires a receiving signature but isn't signed by the account key | key=<VALID_PUBLIC_KEY>, receiverSignatureRequired=true | The account creation fails with an INVALID_SIGNATURE response code from the network. | N |
| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------------------|
| 1 | Creates an account that requires a receiving signature | key=<VALID_PUBLIC_KEY>, receiverSignatureRequired=true, signerKeys=[<ASSOCIATED_PRIVATE_KEY>] | The account creation succeeds and the account requires a receiving signature. | N |
| 2 | Creates an account that doesn't require a receiving signature | key=<VALID_KEY>, receiverSignatureRequired=false | The account creation succeeds and the account doesn't require a receiving signature. | N |
| 3 | Creates an account that requires a receiving signature but isn't signed by the account key | key=<VALID_KEY>, receiverSignatureRequired=true | The account creation fails with an INVALID_SIGNATURE response code from the network. | N |

#### JSON Request Example

Expand All @@ -150,8 +150,11 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api
"id": 99232,
"method": "createAccount",
"params": {
"key": "302e020100300506032b65700422042031f8eb3e77a04ebe599c51570976053009e619414f26bdd39676a5d3b2782a1d",
"receiverSignatureRequired": true
"key": "302a300506032b6570032100e9a0f9c81b3a2bb81a4af5fe05657aa849a3b9b0705da1fb52f331f42cf4b496",
"receiverSignatureRequired": true,
"signerKeys": [
"302e020100300506032b65700422042031f8eb3e77a04ebe599c51570976053009e619414f26bdd39676a5d3b2782a1d"
]
}
}
```
Expand Down Expand Up @@ -351,14 +354,14 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api
}
```

### **Decline rewards:**
### **Decline Reward:**

- If true, the account declines receiving a staking reward.

| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|---------------------------------------------------------|----------------------------------------------|--------------------------------------------------------------------------------|-------------------|
| 1 | Creates an account that declines staking rewards | key=<VALID_KEY>, declineStakingRewards=true | The account creation succeeds and the account declines staking rewards. | N |
| 1 | Creates an account that doesn't decline staking rewards | key=<VALID_KEY>, declineStakingRewards=false | The account creation succeeds and the account doesn't decline staking rewards. | N |
| 2 | Creates an account that doesn't decline staking rewards | key=<VALID_KEY>, declineStakingRewards=false | The account creation succeeds and the account doesn't decline staking rewards. | N |

#### JSON Request Example

Expand Down Expand Up @@ -391,11 +394,11 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api

- The bytes to be used as the account's alias. The bytes must be formatted as the calculated last 20 bytes of the keccak-256 hash of an ECDSA primitive key.

| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|-------------------|
| 1 | Creates an account with the keccak-256 hash of an ECDSAsecp256k1 public key | key=<VALID_KEY>, alias=<LAST_20_BYTES_ECDSA_SECP256K1_PUBLIC_KEY_KECCAK_256_HASH>, signerKey=<CORRESPONDING_ECDSA_SECP256K1_PRIVATE_KEY> | The account creation succeeds and the account has the keccak-256 hash of the ECDSAsecp256k1 public key as its alias. | N |
| 2 | Creates an account with the keccak-256 hash of an ECDSAsecp256k1 public key without a signature | key=<VALID_KEY>, alias=<LAST_20_BYTES_ECDSA_SECP256K1_PUBLIC_KEY_KECCAK_256_HASH> | The account creation fails with an INVALID_SIGNATURE response code from the network. | N |
| 3 | Creates an account with an invalid alias | key=<VALID_KEY>, alias=<INVALID_ALIAS> | The account creation fails with an INVALID_ALIAS_KEY response code from the network. | N |
| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|-------------------|
| 1 | Creates an account with the keccak-256 hash of an ECDSAsecp256k1 public key | key=<VALID_KEY>, alias=<LAST_20_BYTES_ECDSA_SECP256K1_PUBLIC_KEY_KECCAK_256_HASH>, signerKeys=[<CORRESPONDING_ECDSA_SECP256K1_PRIVATE_KEY>] | The account creation succeeds and the account has the keccak-256 hash of the ECDSAsecp256k1 public key as its alias. | N |
| 2 | Creates an account with the keccak-256 hash of an ECDSAsecp256k1 public key without a signature | key=<VALID_KEY>, alias=<LAST_20_BYTES_ECDSA_SECP256K1_PUBLIC_KEY_KECCAK_256_HASH> | The account creation fails with an INVALID_SIGNATURE response code from the network. | N |
| 3 | Creates an account with an invalid alias | key=<VALID_KEY>, alias=<INVALID_ALIAS> | The account creation fails with an INVALID_ALIAS_KEY response code from the network. | N |

#### JSON Request Example

Expand All @@ -407,7 +410,9 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api
"params": {
"key": "302e020100300506032b65700422042031f8eb3e77a04ebe599c51570976053009e619414f26bdd39676a5d3b2782a1d",
"alias": "990a3f6573669cc6266c00983dc24359bd4b223b",
"signerKey": "30540201010420c5f9d140822511e581228feb2bde5a9706ee4c4377822e7cf4755fec529f0bcfa00706052b8104000aa124032200038064ccfe93ce1492ada790da7204edd8e3fd004ee68e4fae7641e00db20527c5"
"signerKeys": [
"30540201010420c5f9d140822511e581228feb2bde5a9706ee4c4377822e7cf4755fec529f0bcfa00706052b8104000aa124032200038064ccfe93ce1492ada790da7204edd8e3fd004ee68e4fae7641e00db20527c5"
]
}
}
```
Expand Down