Skip to content

Commit

Permalink
Add storage score test vector
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Dec 21, 2023
1 parent 8a78c71 commit 9bd48fd
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tips/TIP-0040/tip-0040.md
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,49 @@ be set to or compared against the future-bounded slot index, which prevents faki
index is always at most equal to the slot to which the block belongs, based on its `Issuing Time`, since the newest,
valid commitment that can be picked is `Min Committable Age` slots old.

# Test Vectors

The protocol parameters used in the following test vectors are the same as in
[TIP-49 (Protocol Parameters Hash)](../TIP-0049/tip-0049.md#protocol-parameters-hash).

## Storage Score

The following test vector shows the calculation of the storage score according to [TIP-47](../TIP-0047/tip-0047.md).

Delegation Output (json-encoded):

```json
{
"type": 5,
"amount": "200000000",
"delegatedAmount": "500000000",
"delegationId": "0x08b987baffaacb9da156734275ee01a42a35fe06653823be654821a7ddf92380",
"validatorAddress": {
"type": 8,
"accountId": "0x17432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a"
},
"startEpoch": 30,
"endEpoch": 50,
"unlockConditions": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0xed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a"
}
}
]
}
```

Delegation Output (hex-encoded binary serialization):

```
0x0500c2eb0b000000000065cd1d0000000008b987baffaacb9da156734275ee01a42a35fe06653823be654821a7ddf923800817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a1e00000032000000010000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a
```

Delegation Output Storage Score: `313`.

# Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 comments on commit 9bd48fd

Please sign in to comment.