Skip to content

Commit

Permalink
Merge pull request #17 from casper-network/detached13
Browse files Browse the repository at this point in the history
Any Value Feature
  • Loading branch information
meywood authored Dec 18, 2023
2 parents 42ff16d + d1f84a2 commit 6054b1a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 69 deletions.
80 changes: 11 additions & 69 deletions features/any_value.feature
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
Feature: Any Values

Scenario: Simple Any Values
Given an Any value contains a "Bool" value of "true"
Then the any value's bytes are "01"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "01"
And the type of the any is "Bool" with a value of "true"

Given an Any value contains a "ByteArray" value of "d2029649"
Then the any value's bytes are "d2029649"
Expand All @@ -15,68 +9,16 @@ Feature: Any Values
When the any is read from the deploy
Then the any value's bytes are "d2029649"

Given an Any value contains a "I32" value of "1234567890"
Then the any value's bytes are "d2029649"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "d2029649"
Scenario: Read Map of Any Values from JSON
Given that the map of public keys to any types is read from resource "map_public_key_any.json"
Then the loaded CLMap will contain 1 elements
And the nested map key type will be "PublicKey"
And the nested map value type will be "Any"
And the maps bytes will be "040000002900000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0c6f96930d7c711ff2d5da7f070501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0c31ae13f328d1d00febb0c305014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0c9d6ed6e076dc7e0cf3ee29070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10cffd5d01f2e6671f5cd9c190601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0c0a3d1236165ad983525e550704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190c940795ca8ee8167e6e2dee0501863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0c7bc4bd606a98ce5d9088fd06020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0c2f91f09604bfd8a33003460601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100c131d7f18ac3201b0f526d006010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0c95382fdfc224a651cb6473062a00000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0c19eec0f4a689d6ee292eb4070501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0cf17ff04c4092f0b8dbb8e805014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0cd9982a2ba477993485565b070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10c2dd5861643a42d738090410601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0c0a552fef50244a557941880704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190cfe18825296f77c528ca5140601863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0c0d602be2f4439c1ee0682d07020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0c86d4b1387e01e088257e6f0601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100c37ccce927ff5f3c40d74fe06010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0c5a680e88f34f88e2f7729e062b00000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0ccfdfefce8ff1045aa48de8070501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0c3da5a4fc060a281aa6b40d06014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0cf14b794f0ce532c5f1c58c070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10c17391b7c8a16faae587c690601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0ceb9afddd2320032bb72ebb0704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190c1fea96ed72db294993133b0601863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0cb080bfd71d017d609e4e5d07020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0cdb8551aec6386313acf3980601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100c8de339d3b3f42cfdf6c32c07010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0cfc22d7b23045b376537ec9062c00000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0c24b693d11928c1e7f3f81c080501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0c74103c70aab9607f9ba43206014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0c1b00f3a825e19847053dbe070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10c79c6dc989e00891f8a60910601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0c47f84b42abac1334c925ee0704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190c4fce83ff18350e33c677610601863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0c0e844b32ec18c2eaa7398d07020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0c76847daae71b117ce763c20601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100cd7014394a02325469f165b07010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0cab0686483311ae20f086f406"
And the nested map keys value will be "????????????????????????????"
# We don't know the length yet till we have this working
And the nested map any values bytes length will by 22
And the nested map any values bytes will by "????????????????????????????"

Given an Any value contains a "I64" value of "102030405060708090"
Then the any value's bytes are "fac6eee11c7c6a01"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "fac6eee11c7c6a01"

Given an Any value contains a "String" value of "The quick brown fox jumps over the lazy dog."
Then the any value's bytes are "2c00000054686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "2c00000054686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e"

Given an Any value contains a "U8" value of "15"
Then the any value's bytes are "0f"

Given an Any value contains a "U32" value of "1234567890"
Then the any value's bytes are "d2029649"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "d2029649"

Given an Any value contains a "U64" value of "102030405060708090"
Then the any value's bytes are "fac6eee11c7c6a01"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "fac6eee11c7c6a01"

Given an Any value contains a "U128" value of "102030405060708090"
Then the any value's bytes are "08fac6eee11c7c6a01"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "08fac6eee11c7c6a01"

Given an Any value contains a "U256" value of "102030405060708090102030405060708090"
Then the any value's bytes are "0ffac696b1fd5d40dc69265dc37ca613"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "0ffac696b1fd5d40dc69265dc37ca613"

Given an Any value contains a "U512" value of "102030405060708090102030405060708090102030405060708090"
Then the any value's bytes are "17fac696b19d1300622227dcf324306f3cdea13d09b41001"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "17fac696b19d1300622227dcf324306f3cdea13d09b41001"

Given an Any value contains a "Any" value of "102030405060708090102030405060708090102030405060708090"
Then the any value's bytes are "102030405060708090102030405060708090102030405060708090"
Given that the any value is deployed in a transfer as a named argument
And the transfer containing the any value is successfully executed
When the any is read from the deploy
Then the any value's bytes are "102030405060708090102030405060708090102030405060708090"
15 changes: 15 additions & 0 deletions json/map_public_key_any.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cl_type": {
"Map": {
"key": "U64",
"value": {
"Map": {
"key": "PublicKey",
"value": "Any"
}
}
}
},
"bytes": "040000002900000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0c6f96930d7c711ff2d5da7f070501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0c31ae13f328d1d00febb0c305014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0c9d6ed6e076dc7e0cf3ee29070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10cffd5d01f2e6671f5cd9c190601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0c0a3d1236165ad983525e550704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190c940795ca8ee8167e6e2dee0501863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0c7bc4bd606a98ce5d9088fd06020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0c2f91f09604bfd8a33003460601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100c131d7f18ac3201b0f526d006010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0c95382fdfc224a651cb6473062a00000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0c19eec0f4a689d6ee292eb4070501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0cf17ff04c4092f0b8dbb8e805014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0cd9982a2ba477993485565b070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10c2dd5861643a42d738090410601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0c0a552fef50244a557941880704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190cfe18825296f77c528ca5140601863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0c0d602be2f4439c1ee0682d07020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0c86d4b1387e01e088257e6f0601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100c37ccce927ff5f3c40d74fe06010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0c5a680e88f34f88e2f7729e062b00000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0ccfdfefce8ff1045aa48de8070501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0c3da5a4fc060a281aa6b40d06014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0cf14b794f0ce532c5f1c58c070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10c17391b7c8a16faae587c690601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0ceb9afddd2320032bb72ebb0704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190c1fea96ed72db294993133b0601863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0cb080bfd71d017d609e4e5d07020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0cdb8551aec6386313acf3980601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100c8de339d3b3f42cfdf6c32c07010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0cfc22d7b23045b376537ec9062c00000000000000050000000126cdbd19e88ee80a81085496f978db30eb6f6e5a7ca8b9ca09784aa69c0a430d0c24b693d11928c1e7f3f81c080501000000011fbd4581c54be4fc22712503e1f20cc5a91a82756084dd83e7538efe3704f7dc0c74103c70aab9607f9ba43206014bf2447beef8de654bcce30f603b15fe7c2db0d25885eb9187dfc7a0941679ce0c1b00f3a825e19847053dbe070301000000012c72fc769b0468d7b6148cfa2b31daee53443957fe90014d254661b5751e7fb10c79c6dc989e00891f8a60910601549302f596d4f81fe8908f8f15e42dfcc5745436e34031d99e58751605f5137b0c47f84b42abac1334c925ee0704010000000191078e05d3b6f316a985b084650f903dcd078bc81847dae5c66846e6006bf1190c4fce83ff18350e33c677610601863bd8411dc12844116da7fd4c4a7cdf99654fafd3be07303a64e5647538803e0c0e844b32ec18c2eaa7398d07020100000001815f8016da70ae9ad1af559e1c50c9309dd8edd401a53d3fa3396b8bf8ca158b0c76847daae71b117ce763c20601dce35bd175facd8cf97f9449a42d5f83c4c1f775f72e134ce7e3d5712a304f100cd7014394a02325469f165b07010100000001f585b491a6e38c424524516c86834a6774010160f3dac8503020aae56b62564b0cab0686483311ae20f086f406",
"parsed": null
}

0 comments on commit 6054b1a

Please sign in to comment.