From af5ba025ee6b53722e05a2068116ecd2f6267a4d Mon Sep 17 00:00:00 2001 From: Abdullah Jan Khan Date: Mon, 4 Jul 2022 13:58:04 +0500 Subject: [PATCH 1/3] fix: coin minted amount to fixed --- x/pylons/keeper/msg_server_apple_iap.go | 2 +- .../keeper/msg_server_google_iap_get_coins.go | 2 +- x/pylons/types/errors.go | 1 + x/pylons/types/params.go | 6 +- x/pylons/types/params.pb.go | 121 +++++++++--------- 5 files changed, 67 insertions(+), 65 deletions(-) diff --git a/x/pylons/keeper/msg_server_apple_iap.go b/x/pylons/keeper/msg_server_apple_iap.go index 6c6a5fb661..6a69cfec82 100644 --- a/x/pylons/keeper/msg_server_apple_iap.go +++ b/x/pylons/keeper/msg_server_apple_iap.go @@ -24,7 +24,7 @@ func (k msgServer) AppleIap(goCtx context.Context, msg *types.MsgAppleIap) (*typ } if k.HasAppleIAPOrder(ctx, receipt.PurchaseID) { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "the Apple IAP order ID is already being used") + return nil, sdkerrors.Wrap(types.ErrReceiptAlreadyUsed, "the Apple IAP order ID is already being used") } var coinIssuer types.CoinIssuer diff --git a/x/pylons/keeper/msg_server_google_iap_get_coins.go b/x/pylons/keeper/msg_server_google_iap_get_coins.go index 4a937bef17..036aae1a30 100644 --- a/x/pylons/keeper/msg_server_google_iap_get_coins.go +++ b/x/pylons/keeper/msg_server_google_iap_get_coins.go @@ -14,7 +14,7 @@ func (k msgServer) GoogleInAppPurchaseGetCoins(goCtx context.Context, msg *types ctx := sdk.UnwrapSDKContext(goCtx) if k.HasGoogleIAPOrder(ctx, msg.PurchaseToken) { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "the Google IAP order ID is already being used") + return nil, sdkerrors.Wrap(types.ErrReceiptAlreadyUsed, "the Google IAP order ID is already being used") } // find matching package from list of coin issuers diff --git a/x/pylons/types/errors.go b/x/pylons/types/errors.go index 1f2d638fae..a156390b09 100644 --- a/x/pylons/types/errors.go +++ b/x/pylons/types/errors.go @@ -14,4 +14,5 @@ var ( ErrInvalidPendingExecution = sdkerrors.Register(ModuleName, 1103, "completing execution would create an inconsistent state") ErrDuplicateUsername = sdkerrors.Register(ModuleName, 1104, "username already taken by another account") ErrItemLocked = sdkerrors.Register(ModuleName, 1105, "item locked") + ErrReceiptAlreadyUsed = sdkerrors.Register(ModuleName, 1106, "receipt already used") ) diff --git a/x/pylons/types/params.go b/x/pylons/types/params.go index caf6f58296..1d5eea530c 100644 --- a/x/pylons/types/params.go +++ b/x/pylons/types/params.go @@ -27,9 +27,9 @@ var ( { CoinDenom: PylonsCoinDenom, Packages: []GoogleInAppPurchasePackage{ - {PackageName: "tech.pylons.wallet", ProductId: "pylons_10", Amount: sdk.NewInt(10)}, - {PackageName: "tech.pylons.wallet", ProductId: "pylons_35", Amount: sdk.NewInt(35)}, - {PackageName: "tech.pylons.wallet", ProductId: "pylons_60", Amount: sdk.NewInt(60)}, + {PackageName: "tech.pylons.wallet", ProductId: "pylons_10", Amount: sdk.NewInt(10000000)}, + {PackageName: "tech.pylons.wallet", ProductId: "pylons_35", Amount: sdk.NewInt(35000000)}, + {PackageName: "tech.pylons.wallet", ProductId: "pylons_60", Amount: sdk.NewInt(60000000)}, }, GoogleInAppPurchasePubKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuMzgsJOZzyZvmOG8T9baGxDR/DWx6dgku7UdDfc6aGKthPGYouOa4KvLGEuNd+YTilwtEEryi3mmYAtl8MNtiAQCiry7HjdRNle8lLUHSKwBLVCswY3WGEAuW+5mo/V6X0klS8se65fIqCv2x/SKjtTZvKO/Oe3uehREMY1b8uWLrD5roubXzmaLsFGIRi5wdg8UWRe639LCNb2ghD2Uw0svBTJqn/ymsPmCfVjmCNNRDxfxzlA8O4EEKCK1qOdwIejMAfFMrN87u+0HTQbCKQ/xUQrR6fUhWT2mqttBGhi1NmTNBlUDyXYU+7ILbfJUVqQcKNDbFQd+xv9wBnXAhwIDAQAB", EntityName: "Pylons_Inc", diff --git a/x/pylons/types/params.pb.go b/x/pylons/types/params.pb.go index 29882c0d4b..996699b910 100644 --- a/x/pylons/types/params.pb.go +++ b/x/pylons/types/params.pb.go @@ -318,66 +318,67 @@ func init() { func init() { proto.RegisterFile("pylons/params.proto", fileDescriptor_32b96d3026fd9730) } var fileDescriptor_32b96d3026fd9730 = []byte{ - // 934 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x8f, 0xdb, 0x44, - 0x14, 0x5e, 0xef, 0x86, 0xd0, 0x9d, 0x68, 0x2b, 0x76, 0xb2, 0x55, 0x9d, 0x6d, 0x89, 0xb7, 0xc3, - 0x0f, 0xad, 0x2a, 0xea, 0xa8, 0x2d, 0x07, 0xe8, 0xa5, 0x22, 0x5d, 0x8a, 0x02, 0xa2, 0x8a, 0x0c, - 0x0b, 0x52, 0x2f, 0xd6, 0xc4, 0x79, 0xeb, 0xb5, 0x12, 0xcf, 0x18, 0xcf, 0x78, 0x95, 0x88, 0x03, - 0x70, 0xe7, 0x80, 0xc4, 0x85, 0x23, 0xe2, 0xc4, 0x9d, 0x7f, 0xa2, 0xc7, 0x1e, 0x11, 0x07, 0x0b, - 0xed, 0x8a, 0x7f, 0x20, 0x7f, 0x01, 0xf2, 0xcc, 0x24, 0x71, 0x36, 0x89, 0x60, 0xd5, 0x93, 0x47, - 0x7e, 0x6f, 0xbe, 0xef, 0x7b, 0xef, 0x7d, 0x7e, 0x32, 0xaa, 0x27, 0xe3, 0x21, 0x67, 0xa2, 0x95, - 0xd0, 0x94, 0xc6, 0xc2, 0x4d, 0x52, 0x2e, 0x39, 0xb6, 0xbb, 0xea, 0xa5, 0x84, 0xe0, 0xd4, 0xd5, - 0x71, 0xf3, 0xd8, 0xdf, 0x0b, 0x79, 0xc8, 0x55, 0x52, 0xab, 0x38, 0xe9, 0xfc, 0xfd, 0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 0xbc, 0x69, 0xbd, 0x38, 0x6f, 0x5a, 0x2f, 0xcf, 0x9b, 0xd6, - 0xdf, 0xe7, 0x4d, 0xeb, 0xa7, 0x8b, 0xe6, 0xc6, 0xcb, 0x8b, 0xe6, 0xc6, 0x9f, 0x17, 0xcd, 0x8d, - 0xe7, 0xef, 0x95, 0xa6, 0xa6, 0x37, 0xc8, 0xbd, 0x62, 0x85, 0xb4, 0xcc, 0xbf, 0xce, 0x68, 0x7a, - 0x50, 0xf3, 0xeb, 0x55, 0xd5, 0x4f, 0xca, 0xc3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x57, 0x2e, - 0x63, 0x07, 0x0b, 0x09, 0x00, 0x00, + // 948 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x26, 0x21, 0xad, 0xc7, 0xa4, 0x22, 0xe3, 0x44, 0x5d, 0xa7, 0xc5, 0x9b, 0x0e, 0x7f, + 0x14, 0x01, 0xb5, 0xd5, 0xd2, 0x03, 0xca, 0xa5, 0xc2, 0x94, 0x22, 0x83, 0xa8, 0xac, 0x85, 0x80, + 0xc4, 0x65, 0x35, 0x5e, 0xbf, 0x6c, 0x56, 0xf6, 0xce, 0x0c, 0x3b, 0xb3, 0x91, 0x2d, 0x2e, 0x88, + 0x4f, 0x00, 0xe2, 0xc2, 0x11, 0x71, 0xe2, 0x33, 0xf0, 0x09, 0x7a, 0xec, 0x11, 0x71, 0x58, 0xa1, + 0xe4, 0xc0, 0xdd, 0x9f, 0x00, 0xed, 0xcc, 0xd8, 0x59, 0xdb, 0xb1, 0x50, 0xe8, 0xc9, 0xb3, 0xf3, + 0xde, 0xfe, 0x7e, 0xbf, 0xf7, 0xde, 0x6f, 0x9f, 0x8c, 0x6a, 0x62, 0x3c, 0xe4, 0x4c, 0xb6, 0x04, + 0x4d,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xce, 0x4c, 0x9c, 0xf8, 0xf3, 0xf9, + 0xf8, 0x03, 0xb4, 0x5d, 0xb4, 0x65, 0x24, 0x3b, 0xac, 0x3d, 0xe4, 0xe1, 0xc0, 0xad, 0x6a, 0x80, + 0xd2, 0xce, 0xd6, 0x8d, 0x1c, 0x49, 0xe2, 0xcf, 0x27, 0x1e, 0x6d, 0xfe, 0xf2, 0xab, 0xb7, 0xd6, + 0xfe, 0xf4, 0xf7, 0xf3, 0x86, 0xf3, 0xfc, 0xbc, 0xe1, 0xbc, 0x38, 0x6f, 0x38, 0x7f, 0x9f, 0x37, + 0x9c, 0x1f, 0x2f, 0x1a, 0x6b, 0x2f, 0x2e, 0x1a, 0x6b, 0x7f, 0x5e, 0x34, 0xd6, 0xbe, 0x79, 0xaf, + 0x34, 0x35, 0xb3, 0x41, 0xee, 0x17, 0x2b, 0xa4, 0x65, 0xff, 0xf9, 0x8c, 0xa6, 0x07, 0x3d, 0xbf, + 0xde, 0x96, 0xfe, 0xcb, 0xf2, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x7d, 0x32, 0xce, + 0x19, 0x09, 0x00, 0x00, } func (this *GoogleInAppPurchasePackage) Equal(that interface{}) bool { From 4cfb956f648a6a139e6bccb16dc051b6b9bab383 Mon Sep 17 00:00:00 2001 From: Abdullah Jan Khan Date: Mon, 4 Jul 2022 14:37:32 +0500 Subject: [PATCH 2/3] fix: test cases were updated for in app purchases --- x/pylons/keeper/msg_server_apple_iap_test.go | 8 ++++---- x/pylons/keeper/msg_server_google_iap_get_coins_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x/pylons/keeper/msg_server_apple_iap_test.go b/x/pylons/keeper/msg_server_apple_iap_test.go index 7335a8556f..8d328240cc 100644 --- a/x/pylons/keeper/msg_server_apple_iap_test.go +++ b/x/pylons/keeper/msg_server_apple_iap_test.go @@ -50,7 +50,7 @@ func (suite *IntegrationTestSuite) TestMsgServerappleInAppPurchaseGetCoins() { ProductID: "pylons_10", PurchaseID: "2000000086523782", }, - balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(10))), + balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(10000000))), }, { // valid recipet 2 35 coins @@ -61,7 +61,7 @@ func (suite *IntegrationTestSuite) TestMsgServerappleInAppPurchaseGetCoins() { ProductID: "pylons_35", PurchaseID: "2000000086528808", }, - balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(45))), + balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(45000000))), }, { // valid recipet 3 60 coins @@ -72,7 +72,7 @@ func (suite *IntegrationTestSuite) TestMsgServerappleInAppPurchaseGetCoins() { ProductID: "pylons_60", PurchaseID: "2000000086529484", }, - balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(105))), + balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(105000000))), }, { // invalid product id is embedded within the receipt data @@ -83,7 +83,7 @@ func (suite *IntegrationTestSuite) TestMsgServerappleInAppPurchaseGetCoins() { ProductID: "pylons_60", PurchaseID: "2000000086529484", }, - err: sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "the Apple IAP order ID is already being used"), + err: sdkerrors.Wrap(types.ErrReceiptAlreadyUsed, "the Apple IAP order ID is already being used"), }, } { tc := tc diff --git a/x/pylons/keeper/msg_server_google_iap_get_coins_test.go b/x/pylons/keeper/msg_server_google_iap_get_coins_test.go index 155f6d7b0e..3009e387ca 100644 --- a/x/pylons/keeper/msg_server_google_iap_get_coins_test.go +++ b/x/pylons/keeper/msg_server_google_iap_get_coins_test.go @@ -58,7 +58,7 @@ func (suite *IntegrationTestSuite) TestMsgServerGoogleInAppPurchaseGetCoins() { ReceiptDataBase64: "eyJvcmRlcklkIjoiR1BBLjMzOTYtNjQwNy00NDUyLTYyMDIwIiwicGFja2FnZU5hbWUiOiJ0ZWNoLnB5bG9ucy53YWxsZXQiLCJwcm9kdWN0SWQiOiJweWxvbnNfMTAiLCJwdXJjaGFzZVRpbWUiOjE2NTU5MDEzMTY5NDEsInB1cmNoYXNlU3RhdGUiOjAsInB1cmNoYXNlVG9rZW4iOiJoZm9vY2Jsam9nZ21kZWlla2ZvbGJpbWUuQU8tSjFPd0Jyc3J3TFNnZ3ZNU1ZMSlI2d2wxeGF4Q1FDRjBNNW9ON3ZpRUVldjVHRVJMOGEwR04zdDh6MVpQcGROcnE4dHBnelpDTTNJZ2NQNXYya2FiRWxObHRzYmg2R0EiLCJhY2tub3dsZWRnZWQiOmZhbHNlfQ==", Signature: "LZXvpQwMzGPUnPx06ueOhHDT8INhvxo+YYpqNK17pv1JoU5efoQk7/nHiNvMIHUaX9n0DRF0+Cg/VhZw70zvb4n+18jqRRyKBj/wHt8VSJEco1cHmnwh15OE4FY49YINidBERCBo01xD6qhuMnh7ZB0CwWRBSrDLHKuk4Y9Qybhn72/MtVeMCs+4aK1iWi7iJ9ABfHFbbomFDkOSQvxwAboPcg7VfiZMXS2K67dxWK6YaSQVc21zLtABgigiAqg6mRKiG5d2BdHSXo5qh13f/py2fj6CRf+b9lcVDM0cDGXcsBkPME/OUWQNyqd2tFMlcZn6SwOR7suuzzoB4A8rHg==", }, - balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(10))), + balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(10000000))), }, { desc: "Valid2", @@ -69,7 +69,7 @@ func (suite *IntegrationTestSuite) TestMsgServerGoogleInAppPurchaseGetCoins() { ReceiptDataBase64: "eyJvcmRlcklkIjoiR1BBLjMzODYtMjU3MC00NDY4LTQ3MTY0IiwicGFja2FnZU5hbWUiOiJ0ZWNoLnB5bG9ucy53YWxsZXQiLCJwcm9kdWN0SWQiOiJweWxvbnNfMzUiLCJwdXJjaGFzZVRpbWUiOjE2NTU5MDEzNjk3NTUsInB1cmNoYXNlU3RhdGUiOjAsInB1cmNoYXNlVG9rZW4iOiJuZmlwZnBqYWNoYmZkb2xwaWtoaGJpZWEuQU8tSjFPeDEyNWRHMzI1MGphWGxiZHJWem4wQ2ZOdHlsMUE1MWQ2ZjdJM29xQkhBUXc3TjNZS1VsWWhWRGM4SEVZVGFMQ3pZUnBWcEI4TmpxVlpVUzNrXzZKMEF0LWotM3ciLCJhY2tub3dsZWRnZWQiOmZhbHNlfQ==", Signature: "kj8+9dVWtJbCtT92KhrXiXpq6oDfSu+yq+eOGjsiX856vS4ZD0JptbV0aB75NV2vIfbmsMcWafuLip64c78akqPxCwXTCH1eNcJxzHdsUumYt7y7BrdsrDc7PwDTloV9+Qe2ReRVUQISD4a+J7fGiQTVHkAbVvUoRAtShojByJHxqgMIx2/WGqtY+tDwlyqMtc44JlK+zrEn+1n93/v6ZS9X1Nv+I9HYWMhdxMXaJ+POnxH7hz/2LzKWlyoi82L/RBouOVzGpVfqiqyap0hiVxmQPP6K+vNBSiUgreNpMD+2qlslOHDugORgjqHf1eLs4hrBO99iDjYMWX5g+Bz0bQ==", }, - balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(45))), + balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(45000000))), }, { desc: "Valid3", @@ -80,7 +80,7 @@ func (suite *IntegrationTestSuite) TestMsgServerGoogleInAppPurchaseGetCoins() { ReceiptDataBase64: "eyJvcmRlcklkIjoiR1BBLjMzMTgtMjc2MS0zODk1LTI5NDcwIiwicGFja2FnZU5hbWUiOiJ0ZWNoLnB5bG9ucy53YWxsZXQiLCJwcm9kdWN0SWQiOiJweWxvbnNfNjAiLCJwdXJjaGFzZVRpbWUiOjE2NTU5MDEzODY4MjAsInB1cmNoYXNlU3RhdGUiOjAsInB1cmNoYXNlVG9rZW4iOiJtY25wa25vamtwY2lnZWdib21jaGlraW4uQU8tSjFPeUZlZ1kxRkRlTkE5S3psWWVFbU9Jd2tYaUFYZWhmVnlsb3F2YjhUWGYyV21vYnIxdzhlbWNjQUtuamV6XzllNk5DMWk0Q0txN0tuVGxQa2tTa2xkVnI4QzFjMWciLCJhY2tub3dsZWRnZWQiOmZhbHNlfQ==", Signature: "FREfEWfRXaNzRCgD6MLAaKpc1kZ2FbNVfeXLazKoxpY4tHFo1VsmEqCPdsYymCZys0yehWczPaQJMkB5YwGgwPSKGtWKgwP68gG6SsO21f5SKqcLjvuWyShspifDNjJ7vNy+XPwfjd6PWwYQWVNogr2dC8dN433X+1guY+FExeT0UwbgY8SedsaxRT2nOH2ONLDVx/rR0+kNie13bg/AUZzRkFKYKtUuUQtXq3F1CyDGg/ARgut0EFNJVaW6nrK9as2/7l6V3/+16iDP3dknk7sL9y+VpgfwFrGwQKX23DR33qepjhh7uY67DjxST7Ci4AoALkYdRJ7/TRyDXKe8xw==", }, - balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(105))), + balance: sdk.NewCoins(sdk.NewCoin(types.PylonsCoinDenom, sdk.NewInt(105000000))), }, { // re-using IAP from Valid1 @@ -92,7 +92,7 @@ func (suite *IntegrationTestSuite) TestMsgServerGoogleInAppPurchaseGetCoins() { ReceiptDataBase64: "eyJvcmRlcklkIjoiR1BBLjMzMTgtMjc2MS0zODk1LTI5NDcwIiwicGFja2FnZU5hbWUiOiJ0ZWNoLnB5bG9ucy53YWxsZXQiLCJwcm9kdWN0SWQiOiJweWxvbnNfNjAiLCJwdXJjaGFzZVRpbWUiOjE2NTU5MDEzODY4MjAsInB1cmNoYXNlU3RhdGUiOjAsInB1cmNoYXNlVG9rZW4iOiJtY25wa25vamtwY2lnZWdib21jaGlraW4uQU8tSjFPeUZlZ1kxRkRlTkE5S3psWWVFbU9Jd2tYaUFYZWhmVnlsb3F2YjhUWGYyV21vYnIxdzhlbWNjQUtuamV6XzllNk5DMWk0Q0txN0tuVGxQa2tTa2xkVnI4QzFjMWciLCJhY2tub3dsZWRnZWQiOmZhbHNlfQ==", Signature: "FREfEWfRXaNzRCgD6MLAaKpc1kZ2FbNVfeXLazKoxpY4tHFo1VsmEqCPdsYymCZys0yehWczPaQJMkB5YwGgwPSKGtWKgwP68gG6SsO21f5SKqcLjvuWyShspifDNjJ7vNy+XPwfjd6PWwYQWVNogr2dC8dN433X+1guY+FExeT0UwbgY8SedsaxRT2nOH2ONLDVx/rR0+kNie13bg/AUZzRkFKYKtUuUQtXq3F1CyDGg/ARgut0EFNJVaW6nrK9as2/7l6V3/+16iDP3dknk7sL9y+VpgfwFrGwQKX23DR33qepjhh7uY67DjxST7Ci4AoALkYdRJ7/TRyDXKe8xw==", }, - err: sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "the Google IAP order ID is already being used"), + err: sdkerrors.Wrap(types.ErrReceiptAlreadyUsed, "the Google IAP order ID is already being used"), }, } { tc := tc From f31b4b3a73accc6d0668f1b96d8cf8c6aa9d2c7b Mon Sep 17 00:00:00 2001 From: Abdullah Jan Khan Date: Tue, 5 Jul 2022 14:01:55 +0500 Subject: [PATCH 3/3] fix: get recipe history url was shortned --- docs/static/openapi.yml | 122 +++++++++++++------------- go.mod | 2 + go.sum | 3 + proto/pylons/query.proto | 2 +- x/pylons/keeper/msg_get_tx_history.go | 4 +- 5 files changed, 70 insertions(+), 63 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index ec93e23cd3..af7fc42ead 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -27189,67 +27189,6 @@ paths: additionalProperties: {} tags: - Query - '/Pylons-tech/pylons/pylons/get_recipe_history/{cookbook_id}/{recipe_id}': - get: - summary: Queries a list of GetRecipeHistory items. - operationId: PylonstechPylonsPylonsGetRecipeHistory - responses: - '200': - description: A successful response. - schema: - type: object - properties: - History: - type: array - items: - type: object - properties: - item_id: - type: string - cookbook_id: - type: string - recipe_id: - type: string - sender: - type: string - sender_name: - type: string - receiver: - type: string - amount: - type: string - created_at: - type: string - format: int64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: cookbook_id - in: path - required: true - type: string - - name: recipe_id - in: path - required: true - type: string - tags: - - Query '/pylons/account/address/{address}': get: summary: Queries a list of getAccountByAddress items. @@ -28294,6 +28233,67 @@ paths: type: boolean tags: - Query + '/pylons/get_recipe_history/{cookbook_id}/{recipe_id}': + get: + summary: Queries a list of GetRecipeHistory items. + operationId: PylonstechPylonsPylonsGetRecipeHistory + responses: + '200': + description: A successful response. + schema: + type: object + properties: + History: + type: array + items: + type: object + properties: + item_id: + type: string + cookbook_id: + type: string + recipe_id: + type: string + sender: + type: string + sender_name: + type: string + receiver: + type: string + amount: + type: string + created_at: + type: string + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: cookbook_id + in: path + required: true + type: string + - name: recipe_id + in: path + required: true + type: string + tags: + - Query /pylons/get_stripe_refund: get: summary: Queries a list of GetStripeRefund items. diff --git a/go.mod b/go.mod index 74a2245058..9a237db641 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,8 @@ require ( require github.com/golang/glog v1.0.0 // indirect require ( + github.com/ghodss/yaml v1.0.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect ) diff --git a/go.sum b/go.sum index d48b510feb..f9618bf1c1 100644 --- a/go.sum +++ b/go.sum @@ -314,6 +314,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -498,6 +499,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 h1:BGNSrTRW4rwfhJiFwvwF4XQ0Y72Jj9YEgxVrtovbD5o= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3/go.mod h1:VHn7KgNsRriXa4mcgtkpR00OXyQY6g67JWMvn+R27A4= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/pylons/query.proto b/proto/pylons/query.proto index b17fb221ad..e59457dbb6 100644 --- a/proto/pylons/query.proto +++ b/proto/pylons/query.proto @@ -27,7 +27,7 @@ service Query { // Queries a list of GetRecipeHistory items. rpc GetRecipeHistory(QueryGetRecipeHistoryRequest) returns (QueryGetRecipeHistoryResponse) { - option (google.api.http).get = "/Pylons-tech/pylons/pylons/get_recipe_history/{cookbook_id}/{recipe_id}"; + option (google.api.http).get = "/pylons/get_recipe_history/{cookbook_id}/{recipe_id}"; } // Queries a list of GetStripeRefund items. diff --git a/x/pylons/keeper/msg_get_tx_history.go b/x/pylons/keeper/msg_get_tx_history.go index 72c41f3b63..731b788f0e 100644 --- a/x/pylons/keeper/msg_get_tx_history.go +++ b/x/pylons/keeper/msg_get_tx_history.go @@ -3,6 +3,7 @@ package keeper import ( "context" "encoding/json" + "math" "net/http" "sort" "strconv" @@ -13,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + q "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/types/tx" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" ) @@ -117,7 +119,7 @@ func GetTxHistory(ctx client.Context, address, denom string, limit, offset int64 func QueryHistoryCosmos(txService tx.ServiceServer, query string) (history *tx.GetTxsEventResponse, err error) { history, err = txService.GetTxsEvent(context.Background(), &tx.GetTxsEventRequest{Events: []string{ query, - }}) + }, Pagination: &q.PageRequest{Limit: math.MaxInt}}) if err != nil { return nil, err }