Skip to content

Commit

Permalink
docs(ethereum): 📖 update documentation with new statements
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-cristino committed Aug 4, 2023
1 parent 7f6bb2a commit fe0964e
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 54 deletions.
50 changes: 27 additions & 23 deletions docs/examples/zencode_cookbook/ethereum/signature_array.data
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{
"addresses": [
"0x2B8070975AF995Ef7eb949AE28ee7706B9039504",
"0x3028806AC293B5aC9b863B685c73813626311DaD",
"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a"
],
"signatures": [
{
"r": "ed8f36c71989f8660e8f5d4adbfd8f1c0288cca90d3a5330b7bf735d71ab52fe",
"s": "7ba0a7827dc4ba707431f1c10babd389f658f8e208b89390a9be3c097579a2ff",
"v": "27"
},
{
"r": "40d305373c648bb6b2bbadebe02ada256a9d0b3d3c37367c0a2795e367b22f73",
"s": "72e40dfc3497927764d1585783d058e4367bb4d24d2107777d7aa4ddcb6593c7",
"v": "27"
},
{
"r": "9e07477c31db612e8c99a950385162373ff41a5b8941470b1aeba43b76c53570",
"s": "05fce6615567dc1944cc02fbed86202b09d92d79fbade425af0d74c328d8f6ae",
"v": "28"
}
],
"signed-string": "I love the Beatles, all but 3"
"addresses_signatures": [
{
"address": "0x2B8070975AF995Ef7eb949AE28ee7706B9039504",
"signature": {
"r": "ed8f36c71989f8660e8f5d4adbfd8f1c0288cca90d3a5330b7bf735d71ab52fe",
"s": "7ba0a7827dc4ba707431f1c10babd389f658f8e208b89390a9be3c097579a2ff",
"v": "27"
}
},
{
"address": "0x3028806AC293B5aC9b863B685c73813626311DaD",
"signature": {
"r": "40d305373c648bb6b2bbadebe02ada256a9d0b3d3c37367c0a2795e367b22f73",
"s": "72e40dfc3497927764d1585783d058e4367bb4d24d2107777d7aa4ddcb6593c7",
"v": "27"
}
},
{
"address": "0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a",
"signature": {
"r": "9e07477c31db612e8c99a950385162373ff41a5b8941470b1aeba43b76c53570",
"s": "05fce6615567dc1944cc02fbed86202b09d92d79fbade425af0d74c328d8f6ae",
"v": "28"
}
}
],
"signed_string": "I love the Beatles, all but 3"
}
7 changes: 3 additions & 4 deletions docs/examples/zencode_cookbook/ethereum/signature_array.zen
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Scenario ethereum: verify sig
Given I have a 'ethereum address array' named 'addresses'
Given I have a 'ethereum signature array' named 'signatures'
Given I have a 'string' named 'signed-string'
Given I have a 'ethereum address signature pair array' named 'addresses_signatures'
Given I have a 'string' named 'signed_string'

When I verify the 'signed-string' has an array of ethereum signatures in 'signatures' by 'addresses'
When I verify the ethereum address signature pair array 'addresses_signatures' of 'signed_string'

Then print the string 'ok'
46 changes: 26 additions & 20 deletions docs/examples/zencode_cookbook/ethereum/verification_result.data
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
{
"addresses": [
"0x2B8070975AF995Ef7eb949AE28ee7706B9039504",
"0x3028806AC293B5aC9b863B685c73813626311DaD",
"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a",
"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a"
],
"signatures": [
"addresses_signatures": [
{
"r": "ed8f36c71989f8660e8f5d4adbfd8f1c0288cca90d3a5330b7bf735d71ab52fe",
"s": "7ba0a7827dc4ba707431f1c10babd389f658f8e208b89390a9be3c097579a2ff",
"v": "27"
"address": "0x2B8070975AF995Ef7eb949AE28ee7706B9039504",
"signature": {
"r": "ed8f36c71989f8660e8f5d4adbfd8f1c0288cca90d3a5330b7bf735d71ab52fe",
"s": "7ba0a7827dc4ba707431f1c10babd389f658f8e208b89390a9be3c097579a2ff",
"v": "27"
}
},
{
"r": "40d305373c648bb6b2bbadebe02ada256a9d0b3d3c37367c0a2795e367b22f73",
"s": "72e40dfc3497927764d1585783d058e4367bb4d24d2107777d7aa4ddcb6593c7",
"v": "27"
"address": "0x3028806AC293B5aC9b863B685c73813626311DaD",
"signature": {
"r": "40d305373c648bb6b2bbadebe02ada256a9d0b3d3c37367c0a2795e367b22f73",
"s": "72e40dfc3497927764d1585783d058e4367bb4d24d2107777d7aa4ddcb6593c7",
"v": "27"
}
},
{
"r": "9e07477c31db612e8c99a950385162373ff41a5b8941470b1aeba43b76c53570",
"s": "05fce6615567dc1944cc02fbed86202b09d92d79fbade425af0d74c328d8f6ae",
"v": "28"
"address": "0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a",
"signature": {
"r": "9e07477c31db612e8c99a950385162373ff41a5b8941470b1aeba43b76c53570",
"s": "05fce6615567dc1944cc02fbed86202b09d92d79fbade425af0d74c328d8f6ae",
"v": "28"
}
},
{
"r": "9e07477c31db612e8c99a950385162373ff41a5b8941470b1aeba43b76c53570",
"s": "05fce6615567dc1944cc02fbed86202b09d92d79fbade425af0d74c328d8f6ae",
"v": "27"
"address": "0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a",
"signature": {
"r": "9e07477c31db612e8c99a950385162373ff41a5b8941470b1aeba43b76c53570",
"s": "05fce6615567dc1944cc02fbed86202b09d92d79fbade425af0d74c328d8f6ae",
"v": "27"
}
}
],
"signed-string": "I love the Beatles, all but 3"
"signed_string": "I love the Beatles, all but 3"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"verification_result":[{"address":"0x2B8070975AF995Ef7eb949AE28ee7706B9039504","status":"verified"},{"address":"0x3028806AC293B5aC9b863B685c73813626311DaD","status":"verified"},{"address":"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a","status":"verified"},{"address":"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a","status":"not verified"}]}
{"result_array":[{"address":"0x2B8070975AF995Ef7eb949AE28ee7706B9039504","status":"verified"},{"address":"0x3028806AC293B5aC9b863B685c73813626311DaD","status":"verified"},{"address":"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a","status":"verified"},{"address":"0xe1C2F1ACb2758c4D88EDb84e0306A0a96682E62a","status":"not verified"}]}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Scenario ethereum: verify sig
Given I have a 'ethereum address array' named 'addresses'
Given I have a 'ethereum signature array' named 'signatures'
Given I have a 'string' named 'signed-string'
Given I have a 'ethereum address signature pair array' named 'addresses_signatures'
Given I have a 'string' named 'signed_string'

When I create the verification result verifying the 'signed-string' has an array of ethereum signatures in 'signatures' by 'addresses'
When I use the ethereum address signature pair array 'addresses_signatures' to create the result array of 'signed_string'

Then print the 'verification result'
Then print the 'result_array'
2 changes: 1 addition & 1 deletion docs/pages/zencode-scenarios-ethereum.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ When the signature is correct, the output will be:

## Multiple signatures verification

Given an array of ethereum signatures, an array of ethereum addresses and the signed message
Given an array that contains pairs of ethereum address and signature and a signed message

[](../_media/examples/zencode_cookbook/ethereum/signature_array.data ':include :type=code json')

Expand Down

0 comments on commit fe0964e

Please sign in to comment.