From 34a0f983a527cff36f20c19ad9b0650a02238e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Vejpustek?= Date: Fri, 18 Aug 2023 16:15:55 +0200 Subject: [PATCH] WSCL: Use PascalCase in json properties --- NWabiSabi | 2 +- .../IntegrationTests/IntegrationTests.cs | 4 +- .../TestVectors/GetAnonymityScores.json | 112 +++++++------- .../TestVectors/GetCredentials.json | 72 ++++----- .../TestVectors/GetOutputsAmounts.json | 56 +++---- .../GetRealCredentialRequests.json | 144 +++++++++--------- .../GetZeroCredentialRequests.json | 50 +++--- .../TestVectors/SelectInputsForRound.json | 102 ++++++------- .../Models/SelectInputsForRound/Utxo.cs | 2 +- WalletWasabi.WabiSabiClientLibrary/Program.cs | 1 + 10 files changed, 273 insertions(+), 272 deletions(-) diff --git a/NWabiSabi b/NWabiSabi index b541d3839f0..4716ab08e84 160000 --- a/NWabiSabi +++ b/NWabiSabi @@ -1 +1 @@ -Subproject commit b541d3839f0874c77549cc25ad43cac764f3a573 +Subproject commit 4716ab08e840c13af35479320241ce82bc548de9 diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/IntegrationTests.cs b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/IntegrationTests.cs index 6366d9a7e28..db8b29da327 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/IntegrationTests.cs +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/IntegrationTests.cs @@ -43,7 +43,7 @@ public async Task TestPostAsync([System.Diagnostics.CodeAnalysis.SuppressMessage public async Task TestCredentialSerialNumberUniquenessAsync() { HttpClient client = _factory.CreateClient(); - string requestContentString = """{ "credentialIssuerParameters": { "cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", "i": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" }, "maxCredentialValue": 255 }"""; + string requestContentString = """{ "credentialIssuerParameters": { "Cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", "I": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" }, "maxCredentialValue": 255 }"""; using StringContent requestContent = new StringContent(requestContentString, Encoding.UTF8, "application/json"); HashSet randomnessHashSet = new(); @@ -53,7 +53,7 @@ public async Task TestCredentialSerialNumberUniquenessAsync() Assert.Equal(HttpStatusCode.OK, response.StatusCode); string responseContentString = await response.Content.ReadAsStringAsync(); - bool isUnique = randomnessHashSet.Add(Regex.Match(responseContentString, "\"randomness\":\"([^\"]*)\"").Groups[1].Value); + bool isUnique = randomnessHashSet.Add(Regex.Match(responseContentString, "\"Randomness\":\"([^\"]*)\"").Groups[1].Value); Assert.True(isUnique); } } diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetAnonymityScores.json b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetAnonymityScores.json index bea95ecf484..bdb5aa6c430 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetAnonymityScores.json +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetAnonymityScores.json @@ -1,111 +1,111 @@ [ { - "name": "", - "request": { - "transactions": [ + "Name": "", + "Request": { + "Transactions": [ { - "internalInputs": [], - "externalInputs": [ + "InternalInputs": [], + "ExternalInputs": [ { - "scriptPubKey": "76a914343f14545ae181898cced42a280e25cc20f7972c88ac", - "value": 4979995320 + "ScriptPubKey": "76a914343f14545ae181898cced42a280e25cc20f7972c88ac", + "Value": 4979995320 } ], - "internalOutputs": [ + "InternalOutputs": [ { - "address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", - "value": 1000000000 + "Address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", + "Value": 1000000000 } ], - "externalOutputs": [ + "ExternalOutputs": [ { - "scriptPubKey": "76a914d51d49df61c406305f14cae176e0e05f200d40b288ac", - "value": 3979990640 + "ScriptPubKey": "76a914d51d49df61c406305f14cae176e0e05f200d40b288ac", + "Value": 3979990640 } ] }, { - "internalInputs": [], - "externalInputs": [ + "InternalInputs": [], + "ExternalInputs": [ { - "scriptPubKey": "76a9143833d325bfc715ec1e902e75456265c0f7d2e41988ac", - "value": 5000000000 + "ScriptPubKey": "76a9143833d325bfc715ec1e902e75456265c0f7d2e41988ac", + "Value": 5000000000 } ], - "internalOutputs": [ + "InternalOutputs": [ { - "address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", - "value": 20000000 + "Address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", + "Value": 20000000 } ], - "externalOutputs": [ + "ExternalOutputs": [ { - "scriptPubKey": "76a914343f14545ae181898cced42a280e25cc20f7972c88ac", - "value": 4979995320 + "ScriptPubKey": "76a914343f14545ae181898cced42a280e25cc20f7972c88ac", + "Value": 4979995320 } ] } ] }, - "expectedStatusCode": 200, - "expectedResponse": { - "results": [ + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "Results": [ { - "address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", - "anonymitySet": 1.0 + "Address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", + "AnonymitySet": 1.0 } ] } }, { - "name": "", - "request": { - "transactions": [ + "Name": "", + "Request": { + "Transactions": [ { - "internalInputs": [ + "InternalInputs": [ { - "address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", - "value": 20000000 + "Address": "bcrt1p0hghqgks9z83pwh3a3jzq3eldgzj8ezjrs247szks3w2nq7s7fhsqtqgg7", + "Value": 20000000 } ], - "externalInputs": [], - "internalOutputs": [], - "externalOutputs": [] + "ExternalInputs": [], + "InternalOutputs": [], + "ExternalOutputs": [] } ] }, - "expectedStatusCode": 500, - "expectedResponse": { - "description": "There is an internal input that references a non-existing transaction." + "ExpectedStatusCode": 500, + "ExpectedResponse": { + "Description": "There is an internal input that references a non-existing transaction." } }, { - "name": "", - "request": {}, - "expectedStatusCode": 500, - "expectedResponse": { - "description": "The Transactions field is required." + "Name": "", + "Request": {}, + "ExpectedStatusCode": 500, + "ExpectedResponse": { + "Description": "The Transactions field is required." } }, { - "name": "", - "request": { - "transactions": [ + "Name": "", + "Request": { + "Transactions": [ { - "internalInputs": [ + "InternalInputs": [ { - "value": "" + "Value": "" } ], - "externalInputs": [], - "internalOutputs": [], - "externalOutputs": [] + "ExternalInputs": [], + "InternalOutputs": [], + "ExternalOutputs": [] } ] }, - "expectedStatusCode": 500, - "expectedResponse": { - "description": "Unable to cast object of type 'System.String' to type 'System.Nullable`1[System.Int64]'." + "ExpectedStatusCode": 500, + "ExpectedResponse": { + "Description": "Unable to cast object of type 'System.String' to type 'System.Nullable`1[System.Int64]'." } } ] diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetCredentials.json b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetCredentials.json index af3644928df..cc4f973e3ca 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetCredentials.json +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetCredentials.json @@ -1,13 +1,13 @@ [ { - "name": "", - "request": { - "credentialIssuerParameters": { - "cw": "03AE7B85AF54FF925D03CB802F5D82AC29D5A191AC463CFC8B457AF13F366F48D1", - "i": "03E6481AD96E7F74D59ADD3ABDB1629286C4BE8C3822E9DCBE83A413DB274240FF" + "Name": "", + "Request": { + "CredentialIssuerParameters": { + "Cw": "03AE7B85AF54FF925D03CB802F5D82AC29D5A191AC463CFC8B457AF13F366F48D1", + "I": "03E6481AD96E7F74D59ADD3ABDB1629286C4BE8C3822E9DCBE83A413DB274240FF" }, - "credentialsResponse": { - "issuedCredentials": [ + "CredentialsResponse": { + "IssuedCredentials": [ { "T": "E251F88BBC8F806C4859AA40D71FD98038E5B5FCFD222F474A3DCA40DF3FC932", "V": "024C0928653E343CF52CA6B9B276F3454956DA29E43B4EDFEFC91FF1FA38AB21E7" @@ -17,7 +17,7 @@ "V": "03C99F82CCB5F40B857EF45F0AE7837183E6CD4CEB83C843A7D6BA25FB59C2010C" } ], - "proofs": [ + "Proofs": [ { "PublicNonces": [ "03891A9491DAAA3C0E9EC81A9D4A3640035824105221556D94D983893CE4C4EDAC", @@ -48,62 +48,62 @@ } ] }, - "credentialsValidationData": { - "transcript": { - "strobe": { - "state": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxp75RF1zZCUq8sJubOjAiS1frTmoGolg6tmKNgxfdVpksAPJJ3OwoVbMtbTquOWQnwBKcD0lX9oRJB+Dy4DKNiG5GknkLD0jgwSJujR8V9/nyMh0eTsCAVSdA7Lp98KDfsCN5gtwO281b4NlsstIlqNIG32n9Faksy3hAbyWC5WsT9+rZf2/9Zo/M5CMmsFxesdxDU63OW03bWlejEi72SdjeopvYI00=", - "position": 32, - "beginPosition": 0, - "currentFlags": 7 + "CredentialsValidationData": { + "Transcript": { + "Strobe": { + "State": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxp75RF1zZCUq8sJubOjAiS1frTmoGolg6tmKNgxfdVpksAPJJ3OwoVbMtbTquOWQnwBKcD0lX9oRJB+Dy4DKNiG5GknkLD0jgwSJujR8V9/nyMh0eTsCAVSdA7Lp98KDfsCN5gtwO281b4NlsstIlqNIG32n9Faksy3hAbyWC5WsT9+rZf2/9Zo/M5CMmsFxesdxDU63OW03bWlejEi72SdjeopvYI00=", + "Position": 32, + "BeginPosition": 0, + "CurrentFlags": 7 } }, - "presented": [ + "Presented": [ { - "value": 0, - "randomness": "D8A3955299FE4F70B82923D49EEB970FFD832D9167B7B0207D2D1F3C3348F6FE", - "mac": { + "Value": 0, + "Randomness": "D8A3955299FE4F70B82923D49EEB970FFD832D9167B7B0207D2D1F3C3348F6FE", + "Mac": { "T": "F5C5B08402FB48EB46764FD80B01F0A1AC215755E91744AF64209B1C8E59AA65", "V": "02346FE45671984AEBB5E9B4C1807A3B220C8BE53B9C699D230F3BA730BD5A798F" } }, { - "value": 0, - "randomness": "B8C8EE853FAE12F3797042197B48B2CB939B89F2BCCDBB6A6404305C13F4CB84", - "mac": { + "Value": 0, + "Randomness": "B8C8EE853FAE12F3797042197B48B2CB939B89F2BCCDBB6A6404305C13F4CB84", + "Mac": { "T": "CB1F8F577DD066BC029A897FA0F3E95EA717EB3FCF1AE5F8E228C803EED3332B", "V": "03ABF5891A646C5AADF3A073B57BD0BF9A85DA07AC98BF8EBDF40CC150446D4292" } } ], - "requested": [ + "Requested": [ { - "value": 19932518, - "randomness": "33428CDA67ED34A0DEC6F58F60C397227FE6A95ED96EA8FBA675F75FBBD17D0A", + "Value": 19932518, + "Randomness": "33428CDA67ED34A0DEC6F58F60C397227FE6A95ED96EA8FBA675F75FBBD17D0A", "Ma": "02B703F195ECCBEDB3F9A2F4F2AA2CB415AB3E776C6E240FCF9CB3FFA10C382681" }, { - "value": 0, - "randomness": "D5AFC243923BDAAAB38CC8405DC611D666A59BAB30457C1ACC109C40C99CC823", + "Value": 0, + "Randomness": "D5AFC243923BDAAAB38CC8405DC611D666A59BAB30457C1ACC109C40C99CC823", "Ma": "021EA0EF6A968ED4AACBCDC7FB26A167543911CD7C278B633D271D08A0ABF21639" } ] } }, - "expectedStatusCode": 200, - "expectedResponse": { - "credentials": [ + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "Credentials": [ { - "value": 19932518, - "randomness": "33428CDA67ED34A0DEC6F58F60C397227FE6A95ED96EA8FBA675F75FBBD17D0A", - "mac": { + "Value": 19932518, + "Randomness": "33428CDA67ED34A0DEC6F58F60C397227FE6A95ED96EA8FBA675F75FBBD17D0A", + "Mac": { "T": "E251F88BBC8F806C4859AA40D71FD98038E5B5FCFD222F474A3DCA40DF3FC932", "V": "024C0928653E343CF52CA6B9B276F3454956DA29E43B4EDFEFC91FF1FA38AB21E7" } }, { - "value": 0, - "randomness": "D5AFC243923BDAAAB38CC8405DC611D666A59BAB30457C1ACC109C40C99CC823", - "mac": { + "Value": 0, + "Randomness": "D5AFC243923BDAAAB38CC8405DC611D666A59BAB30457C1ACC109C40C99CC823", + "Mac": { "T": "5DE47A96D0FAE70EE187AFF8BFA6DDFE2F012FDFA09DB200BF54C21DB99CCDD3", "V": "03C99F82CCB5F40B857EF45F0AE7837183E6CD4CEB83C843A7D6BA25FB59C2010C" } diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetOutputsAmounts.json b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetOutputsAmounts.json index bb9fae0d015..f74d2e79512 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetOutputsAmounts.json +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetOutputsAmounts.json @@ -1,24 +1,24 @@ [ { - "name": "", - "request": { - "inputSize": 58, - "outputSize": 43, - "availableVsize": 394, - "miningFeeRate": 129000, - "allowedOutputAmounts": { - "min": 5000, - "max": 4300000000000 + "Name": "", + "Request": { + "InputSize": 58, + "OutputSize": 43, + "AvailableVsize": 394, + "MiningFeeRate": 129000, + "AllowedOutputAmounts": { + "Min": 5000, + "Max": 4300000000000 }, - "internalAmounts": [ + "InternalAmounts": [ 19932518, 996992518 ], - "externalAmounts": [] + "ExternalAmounts": [] }, - "expectedStatusCode": 200, - "expectedResponse": { - "outputAmounts": [ + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "OutputAmounts": [ 16777216, 16777216, 16777216, @@ -32,27 +32,27 @@ } }, { - "name": "Not enough money", - "request": { - "inputSize": 58, - "outputSize": 43, - "availableVsize": 394, - "miningFeeRate": 129000, - "allowedOutputAmounts": { - "min": 5000, - "max": 4300000000000 + "Name": "Not enough money", + "Request": { + "InputSize": 58, + "OutputSize": 43, + "AvailableVsize": 394, + "MiningFeeRate": 129000, + "AllowedOutputAmounts": { + "Min": 5000, + "Max": 4300000000000 }, - "internalAmounts": [ + "InternalAmounts": [ 4000 ], - "externalAmounts": [ + "ExternalAmounts": [ 30000, 20000 ] }, - "expectedStatusCode": 500, - "expectedResponse": { - "description": "Not enough coins registered to participate in the coinjoin." + "ExpectedStatusCode": 500, + "ExpectedResponse": { + "Description": "Not enough coins registered to participate in the coinjoin." } } ] diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetRealCredentialRequests.json b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetRealCredentialRequests.json index 952545d5e0f..ed52b1b84cd 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetRealCredentialRequests.json +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetRealCredentialRequests.json @@ -1,39 +1,39 @@ [ { - "name": "", - "request": { - "amountsToRequest": [ + "Name": "", + "Request": { + "AmountsToRequest": [ 197, 0 ], - "credentialIssuerParameters": { - "cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", - "i": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" + "CredentialIssuerParameters": { + "Cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", + "I": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" }, - "maxCredentialValue": 255, - "credentialsToPresent": [ + "MaxCredentialValue": 255, + "CredentialsToPresent": [ { - "value": 0, - "randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", - "mac": { + "Value": 0, + "Randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", + "Mac": { "T": "A7BCF8B0DFCABF63E7C97E7594C2B45DCACE791654CB042E26B959545AE85269", "V": "03F02044DCE53353C909ED0424E72316C487570721789BE591E76804DD9E89BFA5" } }, { - "value": 0, - "randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", - "mac": { + "Value": 0, + "Randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", + "Mac": { "T": "F13AB74DE1A39ADCFB25B2A20C29B15EA9F6AF18C4F84C71E03A9FC487F0DA4E", "V": "029F752EABDB266B4A0F5AE559DC86E0763844BF4DEAC52292F2F1DAAA7D45E103" } } ] }, - "expectedStatusCode": 200, - "expectedResponse": { - "realCredentialRequests": { - "credentialsRequest": { + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "RealCredentialRequests": { + "CredentialsRequest": { "Delta": 197, "Presented": [ { @@ -217,43 +217,43 @@ } ] }, - "credentialsResponseValidation": { - "transcript": { - "strobe": { - "state": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACEVie3Hus8VV0FnA2Ffdt3MHoY7GU4reHlGsHVBgFkq1stCL3e1k8Q2/GSESvmT97jPV/+Aq6b7Zsi5DW4yJWfB6NwPkmWfooePofftopVHyX4vwxHCHaKaeSTKJpe5PSi1bz13+iV7RFVSNBSqMzIPb9FJPsoICcb76glcj+W/q3RM+8ymPaukgfmEianYSastckbY6C9FBvEUO6yutmc8eXRUd3tZ7Q=", - "position": 32, - "beginPosition": 0, - "currentFlags": 7 + "CredentialsResponseValidation": { + "Transcript": { + "Strobe": { + "State": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACEVie3Hus8VV0FnA2Ffdt3MHoY7GU4reHlGsHVBgFkq1stCL3e1k8Q2/GSESvmT97jPV/+Aq6b7Zsi5DW4yJWfB6NwPkmWfooePofftopVHyX4vwxHCHaKaeSTKJpe5PSi1bz13+iV7RFVSNBSqMzIPb9FJPsoICcb76glcj+W/q3RM+8ymPaukgfmEianYSastckbY6C9FBvEUO6yutmc8eXRUd3tZ7Q=", + "Position": 32, + "BeginPosition": 0, + "CurrentFlags": 7 } }, - "presented": [ + "Presented": [ { - "value": 0, - "randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", - "mac": { + "Value": 0, + "Randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", + "Mac": { "T": "A7BCF8B0DFCABF63E7C97E7594C2B45DCACE791654CB042E26B959545AE85269", "V": "03F02044DCE53353C909ED0424E72316C487570721789BE591E76804DD9E89BFA5" } }, { - "value": 0, - "randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", - "mac": { + "Value": 0, + "Randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", + "Mac": { "T": "F13AB74DE1A39ADCFB25B2A20C29B15EA9F6AF18C4F84C71E03A9FC487F0DA4E", "V": "029F752EABDB266B4A0F5AE559DC86E0763844BF4DEAC52292F2F1DAAA7D45E103" } } ], - "requested": [ + "Requested": [ { - "value": 197, - "randomness": "B4578BB4EF66F8B7102446793638E1E773194BBB940AC694D607EE88F16DFF10", - "ma": "031F6D242E224A3D05DAB1B06699631C11DB1F4012C7A7E0489192E8BB88091C5D" + "Value": 197, + "Randomness": "B4578BB4EF66F8B7102446793638E1E773194BBB940AC694D607EE88F16DFF10", + "Ma": "031F6D242E224A3D05DAB1B06699631C11DB1F4012C7A7E0489192E8BB88091C5D" }, { - "value": 0, - "randomness": "6B0703BD9DDA41804115C7AD0EDE683C3D4AC4400A5F49D4309D28FCF03A47A9", - "ma": "022604FB976CF02AC8537D7334B432C697E80000A5207168A9F104235C88F8969A" + "Value": 0, + "Randomness": "6B0703BD9DDA41804115C7AD0EDE683C3D4AC4400A5F49D4309D28FCF03A47A9", + "Ma": "022604FB976CF02AC8537D7334B432C697E80000A5207168A9F104235C88F8969A" } ] } @@ -261,37 +261,37 @@ } }, { - "name": "", - "request": { - "amountsToRequest": [], - "credentialIssuerParameters": { - "cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", - "i": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" + "Name": "", + "Request": { + "AmountsToRequest": [], + "CredentialIssuerParameters": { + "Cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", + "I": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" }, - "maxCredentialValue": 255, - "credentialsToPresent": [ + "MaxCredentialValue": 255, + "CredentialsToPresent": [ { - "value": 0, - "randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", - "mac": { + "Value": 0, + "Randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", + "Mac": { "T": "A7BCF8B0DFCABF63E7C97E7594C2B45DCACE791654CB042E26B959545AE85269", "V": "03F02044DCE53353C909ED0424E72316C487570721789BE591E76804DD9E89BFA5" } }, { - "value": 0, - "randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", - "mac": { + "Value": 0, + "Randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", + "Mac": { "T": "F13AB74DE1A39ADCFB25B2A20C29B15EA9F6AF18C4F84C71E03A9FC487F0DA4E", "V": "029F752EABDB266B4A0F5AE559DC86E0763844BF4DEAC52292F2F1DAAA7D45E103" } } ] }, - "expectedStatusCode": 200, - "expectedResponse": { - "realCredentialRequests": { - "credentialsRequest": { + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "RealCredentialRequests": { + "CredentialsRequest": { "Delta": 0, "Presented": [ { @@ -352,34 +352,34 @@ } ] }, - "credentialsResponseValidation": { - "transcript": { - "strobe": { - "state": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA71XdOpDoKe7xxoq77WywSAq9KOGH8bqgokaXe2cvpvb1+d2E8TouFiCeGmQ/H/UpFm7VjpJ/f7KyIWzkG0BXxbhU0whEcoN6TF86Oid6RaQ835YZ/5u34/axYYH96a4Hab31SRfABeqKMrVHop9CKcy6r3Ct2XHlcmzhRexEqgv4WfkoujCoeDrBb5t6y646YoLXqZNIQzrEIDQKDsLehUjYV4fCvWEg=", - "position": 32, - "beginPosition": 0, - "currentFlags": 7 + "CredentialsResponseValidation": { + "Transcript": { + "Strobe": { + "State": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA71XdOpDoKe7xxoq77WywSAq9KOGH8bqgokaXe2cvpvb1+d2E8TouFiCeGmQ/H/UpFm7VjpJ/f7KyIWzkG0BXxbhU0whEcoN6TF86Oid6RaQ835YZ/5u34/axYYH96a4Hab31SRfABeqKMrVHop9CKcy6r3Ct2XHlcmzhRexEqgv4WfkoujCoeDrBb5t6y646YoLXqZNIQzrEIDQKDsLehUjYV4fCvWEg=", + "Position": 32, + "BeginPosition": 0, + "CurrentFlags": 7 } }, - "presented": [ + "Presented": [ { - "value": 0, - "randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", - "mac": { + "Value": 0, + "Randomness": "83811D7815D94DFDCFA5F7F78210C95004CACA43C7039DDFF2EE3789513899A1", + "Mac": { "T": "A7BCF8B0DFCABF63E7C97E7594C2B45DCACE791654CB042E26B959545AE85269", "V": "03F02044DCE53353C909ED0424E72316C487570721789BE591E76804DD9E89BFA5" } }, { - "value": 0, - "randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", - "mac": { + "Value": 0, + "Randomness": "5B71E1E4FD2C7E373EE10C2DF4E5EE432F8677E6DEE36AE8FF667B47C1936BB7", + "Mac": { "T": "F13AB74DE1A39ADCFB25B2A20C29B15EA9F6AF18C4F84C71E03A9FC487F0DA4E", "V": "029F752EABDB266B4A0F5AE559DC86E0763844BF4DEAC52292F2F1DAAA7D45E103" } } ], - "requested": [] + "Requested": [] } } } diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetZeroCredentialRequests.json b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetZeroCredentialRequests.json index 9bb1ac909a1..a55d468aa3e 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetZeroCredentialRequests.json +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/GetZeroCredentialRequests.json @@ -1,17 +1,17 @@ [ { - "name": "", - "request": { - "credentialIssuerParameters": { - "cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", - "i": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" + "Name": "", + "Request": { + "CredentialIssuerParameters": { + "Cw": "02BF822F22E5CF2A1725144FB6898EEBC9AD59AEA2C6267F6E9F819517E2B9B882", + "I": "02720432E49A94D45794D76143914FCD9E7F9669BFD08B0EC8B45891E228D2D6E8" }, - "maxCredentialValue": 255 + "MaxCredentialValue": 255 }, - "expectedStatusCode": 200, - "expectedResponse": { - "zeroCredentialRequests": { - "credentialsRequest": { + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "ZeroCredentialRequests": { + "CredentialsRequest": { "Delta": 0, "Presented": [], "Requested": [ @@ -43,26 +43,26 @@ } ] }, - "credentialsResponseValidation": { - "transcript": { - "strobe": { - "state": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADVFZx/DExBvz9thPcyis+26/SxetaAp2r9D419p72I631+B/lrwTU9ZTgDhCWVoAGhuXg9+qFDY1vdzPzp5JPJoAJmUc57UknPTgIbJBIC1y3dZP6LSUB196Es6NmT0YDySwTzoQxtO6kwOruLUU92yrkrE57px3CtY2ESpiRPhTiNa3lWhpSraWaN/h+CycMG9CFrcCVIbuYiYD4gklmftVRmx1s5eDg=", - "position": 32, - "beginPosition": 0, - "currentFlags": 7 + "CredentialsResponseValidation": { + "Transcript": { + "Strobe": { + "State": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADVFZx/DExBvz9thPcyis+26/SxetaAp2r9D419p72I631+B/lrwTU9ZTgDhCWVoAGhuXg9+qFDY1vdzPzp5JPJoAJmUc57UknPTgIbJBIC1y3dZP6LSUB196Es6NmT0YDySwTzoQxtO6kwOruLUU92yrkrE57px3CtY2ESpiRPhTiNa3lWhpSraWaN/h+CycMG9CFrcCVIbuYiYD4gklmftVRmx1s5eDg=", + "Position": 32, + "BeginPosition": 0, + "CurrentFlags": 7 } }, - "presented": [], - "requested": [ + "Presented": [], + "Requested": [ { - "value": 0, - "randomness": "1A0C466F5D75E4D8AD6765D5F519DBC82B7C343B37F88500EC5E64005393B30D", - "ma": "030370011BCD90170A191190195B77EB62F423B9937D2707ED2C39AB4723945AE8" + "Value": 0, + "Randomness": "1A0C466F5D75E4D8AD6765D5F519DBC82B7C343B37F88500EC5E64005393B30D", + "Ma": "030370011BCD90170A191190195B77EB62F423B9937D2707ED2C39AB4723945AE8" }, { - "value": 0, - "randomness": "4A402975CF746C0FF4BEC24D1E04EB4BB598FEA846B56A21864682FE10E4841A", - "ma": "02D068DD3D9A8AB36752B38B5219246AAF508EC3C5D2FC823532AA3119523CA313" + "Value": 0, + "Randomness": "4A402975CF746C0FF4BEC24D1E04EB4BB598FEA846B56A21864682FE10E4841A", + "Ma": "02D068DD3D9A8AB36752B38B5219246AAF508EC3C5D2FC823532AA3119523CA313" } ] } diff --git a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/SelectInputsForRound.json b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/SelectInputsForRound.json index 6675680de20..e62b37e32d5 100644 --- a/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/SelectInputsForRound.json +++ b/WalletWasabi.WabiSabiClientLibrary.Tests/IntegrationTests/TestVectors/SelectInputsForRound.json @@ -1,87 +1,87 @@ [ { - "name": "", - "request": { - "miningFeeRate": 12000, - "coordinationFeeRate": { - "rate": 0.003, - "plebsDontPayThreshold": 1000000 + "Name": "", + "Request": { + "MiningFeeRate": 12000, + "CoordinationFeeRate": { + "Rate": 0.003, + "PlebsDontPayThreshold": 1000000 }, - "allowedInputAmounts": { - "min": 5000, - "max": 4300000000000 + "AllowedInputAmounts": { + "Min": 5000, + "Max": 4300000000000 }, - "allowedOutputAmounts": { - "min": 5000, - "max": 4300000000000 + "AllowedOutputAmounts": { + "Min": 5000, + "Max": 4300000000000 }, - "allowedInputTypes": [ + "AllowedInputTypes": [ 4, 7 ], - "utxos": [ + "Utxos": [ { "outpoint": "bfd12966dcf309b9a8ecceb58970f4ea30b6a6dd9a76628af5bbed32cf95a5fc00000000", - "amount": 20000000, + "Amount": 20000000, "scriptPubKey": "51207dd17022d0288f10baf1ec6420473f6a0523e4521c155f4056845ca983d0f26f", - "anonymitySet": 1 + "AnonymitySet": 1 }, { - "outpoint": "e8ef00a14d0493168ff4d398dcb5a91a34627ad8cc6accc54bf4a74e97a1b08f00000000", - "amount": 1000000000, + "Outpoint": "e8ef00a14d0493168ff4d398dcb5a91a34627ad8cc6accc54bf4a74e97a1b08f00000000", + "Amount": 1000000000, "scriptPubKey": "51207dd17022d0288f10baf1ec6420473f6a0523e4521c155f4056845ca983d0f26f", - "anonymitySet": 1 + "AnonymitySet": 1 } ], - "anonScoreTarget": 5, - "liquidityClue": 4300000000000, - "semiPrivateThreshold": 2, - "consolidationMode": false + "AnonScoreTarget": 5, + "LiquidityClue": 4300000000000, + "SemiPrivateThreshold": 2, + "ConsolidationMode": false }, - "expectedStatusCode": 200, - "expectedResponse": { - "indices": [ + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "Indices": [ 0, 1 ] } }, { - "name": "", - "request": { - "miningFeeRate": 12000, - "coordinationFeeRate": { - "rate": 0.003, - "plebsDontPayThreshold": 1000000 + "Name": "", + "Request": { + "MiningFeeRate": 12000, + "CoordinationFeeRate": { + "Rate": 0.003, + "PlebsDontPayThreshold": 1000000 }, - "allowedInputAmounts": { - "min": 5000, - "max": 4300000000000 + "AllowedInputAmounts": { + "Min": 5000, + "Max": 4300000000000 }, - "allowedOutputAmounts": { - "min": 5000, - "max": 4300000000000 + "AllowedOutputAmounts": { + "Min": 5000, + "Max": 4300000000000 }, - "allowedInputTypes": [ + "AllowedInputTypes": [ 4, 7 ], - "utxos": [ + "Utxos": [ { - "outpoint": "bfd12966dcf309b9a8ecceb58970f4ea30b6a6dd9a76628af5bbed32cf95a5fc00000000", - "amount": 6200, - "scriptPubKey": "51207dd17022d0288f10baf1ec6420473f6a0523e4521c155f4056845ca983d0f26f", - "anonymitySet": 1 + "Outpoint": "bfd12966dcf309b9a8ecceb58970f4ea30b6a6dd9a76628af5bbed32cf95a5fc00000000", + "Amount": 6200, + "ScriptPubKey": "51207dd17022d0288f10baf1ec6420473f6a0523e4521c155f4056845ca983d0f26f", + "AnonymitySet": 1 } ], - "anonScoreTarget": 5, - "liquidityClue": 4300000000000, - "semiPrivateThreshold": 2, - "consolidationMode": false + "AnonScoreTarget": 5, + "LiquidityClue": 4300000000000, + "SemiPrivateThreshold": 2, + "ConsolidationMode": false }, - "expectedStatusCode": 200, - "expectedResponse": { - "indices": [] + "ExpectedStatusCode": 200, + "ExpectedResponse": { + "Indices": [] } } ] diff --git a/WalletWasabi.WabiSabiClientLibrary/Models/SelectInputsForRound/Utxo.cs b/WalletWasabi.WabiSabiClientLibrary/Models/SelectInputsForRound/Utxo.cs index 2fd28c15369..c634306e833 100644 --- a/WalletWasabi.WabiSabiClientLibrary/Models/SelectInputsForRound/Utxo.cs +++ b/WalletWasabi.WabiSabiClientLibrary/Models/SelectInputsForRound/Utxo.cs @@ -12,7 +12,7 @@ namespace WalletWasabi.WabiSabiClientLibrary.Models.SelectInputsForRound; /// The outpoint identififying the UTXO /// Value of the UTXO in Bitcoin (not effective value). /// Anonymity set assigned to the UTXO. -public record Utxo(OutPoint Outpoint, Money Amount, [property: JsonProperty("scriptPubKey")] string ScriptPubKeyHex, double AnonymitySet) : ISmartCoin +public record Utxo(OutPoint Outpoint, Money Amount, [property: JsonProperty("ScriptPubKey")] string ScriptPubKeyHex, double AnonymitySet) : ISmartCoin { [JsonIgnore] public uint Index => Outpoint.N; diff --git a/WalletWasabi.WabiSabiClientLibrary/Program.cs b/WalletWasabi.WabiSabiClientLibrary/Program.cs index 031e7c0ee2c..52ececd6287 100644 --- a/WalletWasabi.WabiSabiClientLibrary/Program.cs +++ b/WalletWasabi.WabiSabiClientLibrary/Program.cs @@ -44,6 +44,7 @@ public static async Task Main(string[] args) x.SerializerSettings.Converters = JsonSerializationOptions.Default.Settings.Converters; x.SerializerSettings.Converters.Add(new ZeroCredentialsRequestJsonConverter()); x.SerializerSettings.Converters.Add(new RealCredentialsRequestJsonConverter()); + x.SerializerSettings.ContractResolver = JsonSerializationOptions.Default.Settings.ContractResolver; }).ConfigureApiBehaviorOptions(options => { options.SuppressModelStateInvalidFilter = true;