From 9bd48fd04301174c6c60a4deee914e021754130e Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Thu, 21 Dec 2023 13:52:19 +0100 Subject: [PATCH] Add storage score test vector --- tips/TIP-0040/tip-0040.md | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tips/TIP-0040/tip-0040.md b/tips/TIP-0040/tip-0040.md index 30fed7e67..f5b4c2bd6 100644 --- a/tips/TIP-0040/tip-0040.md +++ b/tips/TIP-0040/tip-0040.md @@ -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/).