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 3dcc9f1 commit 3aa7611
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions tips/TIP-0054/tip-0054.md
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,74 @@ and `governance transition`.
<i>address -> output</i> mapping table, so that given an <i>Anchor Address</i>, its most recent unspent anchor output
can be retrieved.

# 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).

Anchor Output (json-encoded):

```json
{
"type": 2,
"amount": "420000000",
"mana": "42",
"anchorId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateIndex": 0,
"unlockConditions": [
{
"type": 4,
"address": {
"type": 8,
"accountId": "0x17432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a"
}
},
{
"type": 5,
"address": {
"type": 8,
"accountId": "0x17432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a"
}
}
],
"features": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0xed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a"
}
},
{
"type": 2,
"entries": {
"iota": "0x322e30"
}
}
],
"immutableFeatures": [
{
"type": 2,
"entries": {
"iota": "0x322e30"
}
}
]
}
```

Anchor Output (hex-encoded binary serialization):

```
0x0200b10819000000002a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000002040817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a050817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a020000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a020104696f74610300322e3001020104696f74610300322e30
```

Anchor Output Storage Score: `270`.

# Copyright

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

0 comments on commit 3aa7611

Please sign in to comment.