diff --git a/CHANGELOG.md b/CHANGELOG.md index 690becd68f..abd59a7956 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ - [#421](https://github.com/Pylons-tech/pylons/pull/421) Add game simulation testing to cli test suite. Tests cover CEL environment execution, item modification and cookbook coin generation. ### Fixes: +- [#346](https://github.com/Pylons-tech/pylons/pull/436) Fixes a bug in `x/pylons/keeper/msg_server_fulfill_trade.go` where a transfer fees were being matched from itemInputs where they should have been from itemOutputs. +- [#346](https://github.com/Pylons-tech/pylons/pull/436) Fixes a bug in `x/pylons/keeper/msg_server_fulfill_trade.go` where a `MatchItemInputsForTrade()` would return an error incorrectly. - [#434](https://github.com/Pylons-tech/pylons/pull/434) Add missing `RegisterStoreDecoder()` functionality in `x/pylons/module.go` to enable module simulation tests. - [#429](https://github.com/Pylons-tech/pylons/pull/429) Dependabot security upgrade - [#421](https://github.com/Pylons-tech/pylons/pull/421) Recipe execution validation and item matching logic fixed. diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile index c0e64b1a8a..70f0741720 100644 --- a/contrib/devtools/Makefile +++ b/contrib/devtools/Makefile @@ -57,10 +57,9 @@ RUNSIM = $(TOOLS_DESTDIR)/runsim runsim: $(RUNSIM) $(RUNSIM): @echo "Installing runsim..." - @(cd /tmp && go install github.com/cosmos/tools/cmd/runsim@v1.0.0) + @(cd /tmp && go install github.com/cosmos/tools/cmd/runsim@master) tools-clean: - rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM) - rm -f proto-tools-stamp tools-stamp + rm -f $(RUNSIM) .PHONY: tools-clean runsim diff --git a/testutil/network/network.go b/testutil/network/network.go index 86f9084995..7c79103d0c 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -6,6 +6,12 @@ import ( "testing" "time" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + + "github.com/Pylons-tech/pylons/x/pylons/client/cli" + "github.com/cosmos/cosmos-sdk/codec" "github.com/Pylons-tech/pylons/x/pylons/types" @@ -45,6 +51,26 @@ func New(t *testing.T, configs ...network.Config) *network.Network { } net := network.New(t, cfg) t.Cleanup(net.Cleanup) + + // create accounts for the validators + for i, val := range net.Validators { + ctx := val.ClientCtx + addr := val.Address.String() + flags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, addr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), + } + + args := []string{fmt.Sprintf("val%d", i)} + args = append(args, flags...) + _, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateAccount(), args) + require.NoError(t, err) + // var resp sdk.TxResponse + // require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) + } + return net } diff --git a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.js b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.js index aaca2a6786..ad33927ec2 100644 --- a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.js +++ b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.js @@ -471,105 +471,105 @@ export default { throw new SpVuexError('QueryClient:QueryCookbook', 'API Node Unavailable. Could not perform query: ' + e.message); } }, - async sendMsgFulfillTrade({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSetItemString({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgFulfillTrade(value); + const msg = await txClient.msgSetItemString(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgFulfillTrade:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgSetItemString:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgCompleteExecutionEarly({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgUpdateAccount({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCompleteExecutionEarly(value); + const msg = await txClient.msgUpdateAccount(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgUpdateAccount:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgCancelTrade({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSendItems({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCancelTrade(value); + const msg = await txClient.msgSendItems(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCancelTrade:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgSendItems:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgSetItemString({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgFulfillTrade({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgSetItemString(value); + const msg = await txClient.msgFulfillTrade(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgSetItemString:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgFulfillTrade:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgCreateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgUpdateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateCookbook(value); + const msg = await txClient.msgUpdateRecipe(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateCookbook:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgUpdateRecipe:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgTransferCookbook({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCompleteExecutionEarly({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgTransferCookbook(value); + const msg = await txClient.msgCompleteExecutionEarly(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgTransferCookbook:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Send', 'Could not broadcast Tx: ' + e.message); } } }, @@ -590,54 +590,54 @@ export default { } } }, - async sendMsgSendItems({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateAccount({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgSendItems(value); + const msg = await txClient.msgCreateAccount(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgSendItems:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateAccount:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgCreateTrade({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgTransferCookbook({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateTrade(value); + const msg = await txClient.msgTransferCookbook(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateTrade:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgTransferCookbook:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgUpdateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCancelTrade({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgUpdateRecipe(value); + const msg = await txClient.msgCancelTrade(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgUpdateRecipe:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgCancelTrade:Send', 'Could not broadcast Tx: ' + e.message); } } }, @@ -658,161 +658,161 @@ export default { } } }, - async sendMsgCreateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgUpdateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateRecipe(value); + const msg = await txClient.msgUpdateCookbook(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateRecipe:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgUpdateCookbook:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgUpdateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateTrade({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgUpdateCookbook(value); + const msg = await txClient.msgCreateTrade(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgUpdateCookbook:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateTrade:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgUpdateAccount({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgUpdateAccount(value); + const msg = await txClient.msgCreateRecipe(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgUpdateAccount:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateRecipe:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async sendMsgCreateAccount({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateAccount(value); + const msg = await txClient.msgCreateCookbook(value); const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee, gas: "200000" }, memo }); return result; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateAccount:Send', 'Could not broadcast Tx: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateCookbook:Send', 'Could not broadcast Tx: ' + e.message); } } }, - async MsgFulfillTrade({ rootGetters }, { value }) { + async MsgSetItemString({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgFulfillTrade(value); + const msg = await txClient.msgSetItemString(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgFulfillTrade:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgSetItemString:Create', 'Could not create message: ' + e.message); } } }, - async MsgCompleteExecutionEarly({ rootGetters }, { value }) { + async MsgUpdateAccount({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCompleteExecutionEarly(value); + const msg = await txClient.msgUpdateAccount(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgUpdateAccount:Create', 'Could not create message: ' + e.message); } } }, - async MsgCancelTrade({ rootGetters }, { value }) { + async MsgSendItems({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCancelTrade(value); + const msg = await txClient.msgSendItems(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCancelTrade:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgSendItems:Create', 'Could not create message: ' + e.message); } } }, - async MsgSetItemString({ rootGetters }, { value }) { + async MsgFulfillTrade({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgSetItemString(value); + const msg = await txClient.msgFulfillTrade(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgSetItemString:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgFulfillTrade:Create', 'Could not create message: ' + e.message); } } }, - async MsgCreateCookbook({ rootGetters }, { value }) { + async MsgUpdateRecipe({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateCookbook(value); + const msg = await txClient.msgUpdateRecipe(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateCookbook:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgUpdateRecipe:Create', 'Could not create message: ' + e.message); } } }, - async MsgTransferCookbook({ rootGetters }, { value }) { + async MsgCompleteExecutionEarly({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgTransferCookbook(value); + const msg = await txClient.msgCompleteExecutionEarly(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgTransferCookbook:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Create', 'Could not create message: ' + e.message); } } }, @@ -831,48 +831,48 @@ export default { } } }, - async MsgSendItems({ rootGetters }, { value }) { + async MsgCreateAccount({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgSendItems(value); + const msg = await txClient.msgCreateAccount(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgSendItems:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateAccount:Create', 'Could not create message: ' + e.message); } } }, - async MsgCreateTrade({ rootGetters }, { value }) { + async MsgTransferCookbook({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateTrade(value); + const msg = await txClient.msgTransferCookbook(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateTrade:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgTransferCookbook:Create', 'Could not create message: ' + e.message); } } }, - async MsgUpdateRecipe({ rootGetters }, { value }) { + async MsgCancelTrade({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgUpdateRecipe(value); + const msg = await txClient.msgCancelTrade(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgUpdateRecipe:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgCancelTrade:Create', 'Could not create message: ' + e.message); } } }, @@ -891,63 +891,63 @@ export default { } } }, - async MsgCreateRecipe({ rootGetters }, { value }) { + async MsgUpdateCookbook({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateRecipe(value); + const msg = await txClient.msgUpdateCookbook(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateRecipe:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgUpdateCookbook:Create', 'Could not create message: ' + e.message); } } }, - async MsgUpdateCookbook({ rootGetters }, { value }) { + async MsgCreateTrade({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgUpdateCookbook(value); + const msg = await txClient.msgCreateTrade(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgUpdateCookbook:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateTrade:Create', 'Could not create message: ' + e.message); } } }, - async MsgUpdateAccount({ rootGetters }, { value }) { + async MsgCreateRecipe({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgUpdateAccount(value); + const msg = await txClient.msgCreateRecipe(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgUpdateAccount:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateRecipe:Create', 'Could not create message: ' + e.message); } } }, - async MsgCreateAccount({ rootGetters }, { value }) { + async MsgCreateCookbook({ rootGetters }, { value }) { try { const txClient = await initTxClient(rootGetters); - const msg = await txClient.msgCreateAccount(value); + const msg = await txClient.msgCreateCookbook(value); return msg; } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.'); + throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.'); } else { - throw new SpVuexError('TxClient:MsgCreateAccount:Create', 'Could not create message: ' + e.message); + throw new SpVuexError('TxClient:MsgCreateCookbook:Create', 'Could not create message: ' + e.message); } } }, diff --git a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.ts b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.ts index 3f3bb3f4f2..9b9cb43f5b 100755 --- a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.ts +++ b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/index.ts @@ -587,93 +587,93 @@ export default { }, - async sendMsgFulfillTrade({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSetItemString({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgFulfillTrade(value) + const msg = await txClient.msgSetItemString(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgFulfillTrade:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgSetItemString:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCompleteExecutionEarly({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgUpdateAccount({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCompleteExecutionEarly(value) + const msg = await txClient.msgUpdateAccount(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgUpdateAccount:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCancelTrade({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSendItems({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCancelTrade(value) + const msg = await txClient.msgSendItems(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCancelTrade:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgSendItems:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSetItemString({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgFulfillTrade({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSetItemString(value) + const msg = await txClient.msgFulfillTrade(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgSetItemString:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgFulfillTrade:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgUpdateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateCookbook(value) + const msg = await txClient.msgUpdateRecipe(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateCookbook:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgUpdateRecipe:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgTransferCookbook({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCompleteExecutionEarly({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgTransferCookbook(value) + const msg = await txClient.msgCompleteExecutionEarly(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgTransferCookbook:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Send', 'Could not broadcast Tx: '+ e.message) } } }, @@ -692,48 +692,48 @@ export default { } } }, - async sendMsgSendItems({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateAccount({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSendItems(value) + const msg = await txClient.msgCreateAccount(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgSendItems:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgCreateAccount:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateTrade({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgTransferCookbook({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateTrade(value) + const msg = await txClient.msgTransferCookbook(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateTrade:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgTransferCookbook:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgUpdateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCancelTrade({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUpdateRecipe(value) + const msg = await txClient.msgCancelTrade(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgUpdateRecipe:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgCancelTrade:Send', 'Could not broadcast Tx: '+ e.message) } } }, @@ -752,147 +752,147 @@ export default { } } }, - async sendMsgCreateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgUpdateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateRecipe(value) + const msg = await txClient.msgUpdateCookbook(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateRecipe:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgUpdateCookbook:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgUpdateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateTrade({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUpdateCookbook(value) + const msg = await txClient.msgCreateTrade(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgUpdateCookbook:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgCreateTrade:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgUpdateAccount({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateRecipe({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUpdateAccount(value) + const msg = await txClient.msgCreateRecipe(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgUpdateAccount:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgCreateRecipe:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateAccount({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateCookbook({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateAccount(value) + const msg = await txClient.msgCreateCookbook(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateAccount:Send', 'Could not broadcast Tx: '+ e.message) + throw new SpVuexError('TxClient:MsgCreateCookbook:Send', 'Could not broadcast Tx: '+ e.message) } } }, - async MsgFulfillTrade({ rootGetters }, { value }) { + async MsgSetItemString({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgFulfillTrade(value) + const msg = await txClient.msgSetItemString(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgFulfillTrade:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgSetItemString:Create', 'Could not create message: ' + e.message) } } }, - async MsgCompleteExecutionEarly({ rootGetters }, { value }) { + async MsgUpdateAccount({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCompleteExecutionEarly(value) + const msg = await txClient.msgUpdateAccount(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgUpdateAccount:Create', 'Could not create message: ' + e.message) } } }, - async MsgCancelTrade({ rootGetters }, { value }) { + async MsgSendItems({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCancelTrade(value) + const msg = await txClient.msgSendItems(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCancelTrade:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgSendItems:Create', 'Could not create message: ' + e.message) } } }, - async MsgSetItemString({ rootGetters }, { value }) { + async MsgFulfillTrade({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSetItemString(value) + const msg = await txClient.msgFulfillTrade(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSetItemString:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgFulfillTrade:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgSetItemString:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgFulfillTrade:Create', 'Could not create message: ' + e.message) } } }, - async MsgCreateCookbook({ rootGetters }, { value }) { + async MsgUpdateRecipe({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateCookbook(value) + const msg = await txClient.msgUpdateRecipe(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateCookbook:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgUpdateRecipe:Create', 'Could not create message: ' + e.message) } } }, - async MsgTransferCookbook({ rootGetters }, { value }) { + async MsgCompleteExecutionEarly({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgTransferCookbook(value) + const msg = await txClient.msgCompleteExecutionEarly(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgTransferCookbook:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgCompleteExecutionEarly:Create', 'Could not create message: ' + e.message) } } @@ -911,44 +911,44 @@ export default { } } }, - async MsgSendItems({ rootGetters }, { value }) { + async MsgCreateAccount({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSendItems(value) + const msg = await txClient.msgCreateAccount(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSendItems:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgSendItems:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgCreateAccount:Create', 'Could not create message: ' + e.message) } } }, - async MsgCreateTrade({ rootGetters }, { value }) { + async MsgTransferCookbook({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateTrade(value) + const msg = await txClient.msgTransferCookbook(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgTransferCookbook:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateTrade:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgTransferCookbook:Create', 'Could not create message: ' + e.message) } } }, - async MsgUpdateRecipe({ rootGetters }, { value }) { + async MsgCancelTrade({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUpdateRecipe(value) + const msg = await txClient.msgCancelTrade(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateRecipe:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCancelTrade:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgUpdateRecipe:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgCancelTrade:Create', 'Could not create message: ' + e.message) } } @@ -967,58 +967,58 @@ export default { } } }, - async MsgCreateRecipe({ rootGetters }, { value }) { + async MsgUpdateCookbook({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateRecipe(value) + const msg = await txClient.msgUpdateCookbook(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateRecipe:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgUpdateCookbook:Create', 'Could not create message: ' + e.message) } } }, - async MsgUpdateCookbook({ rootGetters }, { value }) { + async MsgCreateTrade({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUpdateCookbook(value) + const msg = await txClient.msgCreateTrade(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateCookbook:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateTrade:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgUpdateCookbook:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgCreateTrade:Create', 'Could not create message: ' + e.message) } } }, - async MsgUpdateAccount({ rootGetters }, { value }) { + async MsgCreateRecipe({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgUpdateAccount(value) + const msg = await txClient.msgCreateRecipe(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgUpdateAccount:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateRecipe:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgUpdateAccount:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgCreateRecipe:Create', 'Could not create message: ' + e.message) } } }, - async MsgCreateAccount({ rootGetters }, { value }) { + async MsgCreateCookbook({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateAccount(value) + const msg = await txClient.msgCreateCookbook(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCreateAccount:Init', 'Could not initialize signing client. Wallet is required.') + throw new SpVuexError('TxClient:MsgCreateCookbook:Init', 'Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCreateAccount:Create', 'Could not create message: ' + e.message) + throw new SpVuexError('TxClient:MsgCreateCookbook:Create', 'Could not create message: ' + e.message) } } diff --git a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.d.ts b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.d.ts index 8435480125..1a32563d23 100644 --- a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.d.ts +++ b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.d.ts @@ -1,21 +1,21 @@ import { StdFee } from "@cosmjs/launchpad"; import { OfflineSigner, EncodeObject } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgFulfillTrade } from "./types/pylons/tx"; -import { MsgCompleteExecutionEarly } from "./types/pylons/tx"; -import { MsgCancelTrade } from "./types/pylons/tx"; import { MsgSetItemString } from "./types/pylons/tx"; -import { MsgCreateCookbook } from "./types/pylons/tx"; -import { MsgTransferCookbook } from "./types/pylons/tx"; -import { MsgGoogleInAppPurchaseGetCoins } from "./types/pylons/tx"; +import { MsgUpdateAccount } from "./types/pylons/tx"; import { MsgSendItems } from "./types/pylons/tx"; -import { MsgCreateTrade } from "./types/pylons/tx"; +import { MsgFulfillTrade } from "./types/pylons/tx"; import { MsgUpdateRecipe } from "./types/pylons/tx"; +import { MsgCompleteExecutionEarly } from "./types/pylons/tx"; +import { MsgGoogleInAppPurchaseGetCoins } from "./types/pylons/tx"; +import { MsgCreateAccount } from "./types/pylons/tx"; +import { MsgTransferCookbook } from "./types/pylons/tx"; +import { MsgCancelTrade } from "./types/pylons/tx"; import { MsgExecuteRecipe } from "./types/pylons/tx"; -import { MsgCreateRecipe } from "./types/pylons/tx"; import { MsgUpdateCookbook } from "./types/pylons/tx"; -import { MsgUpdateAccount } from "./types/pylons/tx"; -import { MsgCreateAccount } from "./types/pylons/tx"; +import { MsgCreateTrade } from "./types/pylons/tx"; +import { MsgCreateRecipe } from "./types/pylons/tx"; +import { MsgCreateCookbook } from "./types/pylons/tx"; export declare const MissingWalletError: Error; interface TxClientOptions { addr: string; @@ -26,21 +26,21 @@ interface SignAndBroadcastOptions { } declare const txClient: (wallet: OfflineSigner, { addr: addr }?: TxClientOptions) => Promise<{ signAndBroadcast: (msgs: EncodeObject[], { fee, memo }?: SignAndBroadcastOptions) => Promise; - msgFulfillTrade: (data: MsgFulfillTrade) => EncodeObject; - msgCompleteExecutionEarly: (data: MsgCompleteExecutionEarly) => EncodeObject; - msgCancelTrade: (data: MsgCancelTrade) => EncodeObject; msgSetItemString: (data: MsgSetItemString) => EncodeObject; - msgCreateCookbook: (data: MsgCreateCookbook) => EncodeObject; - msgTransferCookbook: (data: MsgTransferCookbook) => EncodeObject; - msgGoogleInAppPurchaseGetCoins: (data: MsgGoogleInAppPurchaseGetCoins) => EncodeObject; + msgUpdateAccount: (data: MsgUpdateAccount) => EncodeObject; msgSendItems: (data: MsgSendItems) => EncodeObject; - msgCreateTrade: (data: MsgCreateTrade) => EncodeObject; + msgFulfillTrade: (data: MsgFulfillTrade) => EncodeObject; msgUpdateRecipe: (data: MsgUpdateRecipe) => EncodeObject; + msgCompleteExecutionEarly: (data: MsgCompleteExecutionEarly) => EncodeObject; + msgGoogleInAppPurchaseGetCoins: (data: MsgGoogleInAppPurchaseGetCoins) => EncodeObject; + msgCreateAccount: (data: MsgCreateAccount) => EncodeObject; + msgTransferCookbook: (data: MsgTransferCookbook) => EncodeObject; + msgCancelTrade: (data: MsgCancelTrade) => EncodeObject; msgExecuteRecipe: (data: MsgExecuteRecipe) => EncodeObject; - msgCreateRecipe: (data: MsgCreateRecipe) => EncodeObject; msgUpdateCookbook: (data: MsgUpdateCookbook) => EncodeObject; - msgUpdateAccount: (data: MsgUpdateAccount) => EncodeObject; - msgCreateAccount: (data: MsgCreateAccount) => EncodeObject; + msgCreateTrade: (data: MsgCreateTrade) => EncodeObject; + msgCreateRecipe: (data: MsgCreateRecipe) => EncodeObject; + msgCreateCookbook: (data: MsgCreateCookbook) => EncodeObject; }>; interface QueryClientOptions { addr: string; diff --git a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.js b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.js index b1124a2b21..d2836252aa 100644 --- a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.js +++ b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.js @@ -2,37 +2,37 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgFulfillTrade } from "./types/pylons/tx"; -import { MsgCompleteExecutionEarly } from "./types/pylons/tx"; -import { MsgCancelTrade } from "./types/pylons/tx"; import { MsgSetItemString } from "./types/pylons/tx"; -import { MsgCreateCookbook } from "./types/pylons/tx"; -import { MsgTransferCookbook } from "./types/pylons/tx"; -import { MsgGoogleInAppPurchaseGetCoins } from "./types/pylons/tx"; +import { MsgUpdateAccount } from "./types/pylons/tx"; import { MsgSendItems } from "./types/pylons/tx"; -import { MsgCreateTrade } from "./types/pylons/tx"; +import { MsgFulfillTrade } from "./types/pylons/tx"; import { MsgUpdateRecipe } from "./types/pylons/tx"; +import { MsgCompleteExecutionEarly } from "./types/pylons/tx"; +import { MsgGoogleInAppPurchaseGetCoins } from "./types/pylons/tx"; +import { MsgCreateAccount } from "./types/pylons/tx"; +import { MsgTransferCookbook } from "./types/pylons/tx"; +import { MsgCancelTrade } from "./types/pylons/tx"; import { MsgExecuteRecipe } from "./types/pylons/tx"; -import { MsgCreateRecipe } from "./types/pylons/tx"; import { MsgUpdateCookbook } from "./types/pylons/tx"; -import { MsgUpdateAccount } from "./types/pylons/tx"; -import { MsgCreateAccount } from "./types/pylons/tx"; +import { MsgCreateTrade } from "./types/pylons/tx"; +import { MsgCreateRecipe } from "./types/pylons/tx"; +import { MsgCreateCookbook } from "./types/pylons/tx"; const types = [ - ["/Pylonstech.pylons.pylons.MsgFulfillTrade", MsgFulfillTrade], - ["/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", MsgCompleteExecutionEarly], - ["/Pylonstech.pylons.pylons.MsgCancelTrade", MsgCancelTrade], ["/Pylonstech.pylons.pylons.MsgSetItemString", MsgSetItemString], - ["/Pylonstech.pylons.pylons.MsgCreateCookbook", MsgCreateCookbook], - ["/Pylonstech.pylons.pylons.MsgTransferCookbook", MsgTransferCookbook], - ["/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", MsgGoogleInAppPurchaseGetCoins], + ["/Pylonstech.pylons.pylons.MsgUpdateAccount", MsgUpdateAccount], ["/Pylonstech.pylons.pylons.MsgSendItems", MsgSendItems], - ["/Pylonstech.pylons.pylons.MsgCreateTrade", MsgCreateTrade], + ["/Pylonstech.pylons.pylons.MsgFulfillTrade", MsgFulfillTrade], ["/Pylonstech.pylons.pylons.MsgUpdateRecipe", MsgUpdateRecipe], + ["/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", MsgCompleteExecutionEarly], + ["/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", MsgGoogleInAppPurchaseGetCoins], + ["/Pylonstech.pylons.pylons.MsgCreateAccount", MsgCreateAccount], + ["/Pylonstech.pylons.pylons.MsgTransferCookbook", MsgTransferCookbook], + ["/Pylonstech.pylons.pylons.MsgCancelTrade", MsgCancelTrade], ["/Pylonstech.pylons.pylons.MsgExecuteRecipe", MsgExecuteRecipe], - ["/Pylonstech.pylons.pylons.MsgCreateRecipe", MsgCreateRecipe], ["/Pylonstech.pylons.pylons.MsgUpdateCookbook", MsgUpdateCookbook], - ["/Pylonstech.pylons.pylons.MsgUpdateAccount", MsgUpdateAccount], - ["/Pylonstech.pylons.pylons.MsgCreateAccount", MsgCreateAccount], + ["/Pylonstech.pylons.pylons.MsgCreateTrade", MsgCreateTrade], + ["/Pylonstech.pylons.pylons.MsgCreateRecipe", MsgCreateRecipe], + ["/Pylonstech.pylons.pylons.MsgCreateCookbook", MsgCreateCookbook], ]; export const MissingWalletError = new Error("wallet is required"); const registry = new Registry(types); @@ -47,21 +47,21 @@ const txClient = async (wallet, { addr: addr } = { addr: "http://localhost:26657 const { address } = (await wallet.getAccounts())[0]; return { signAndBroadcast: (msgs, { fee, memo } = { fee: defaultFee, memo: "" }) => client.signAndBroadcast(address, msgs, fee, memo), - msgFulfillTrade: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgFulfillTrade", value: data }), - msgCompleteExecutionEarly: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", value: data }), - msgCancelTrade: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCancelTrade", value: data }), msgSetItemString: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgSetItemString", value: data }), - msgCreateCookbook: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateCookbook", value: data }), - msgTransferCookbook: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgTransferCookbook", value: data }), - msgGoogleInAppPurchaseGetCoins: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", value: data }), + msgUpdateAccount: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateAccount", value: data }), msgSendItems: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgSendItems", value: data }), - msgCreateTrade: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateTrade", value: data }), + msgFulfillTrade: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgFulfillTrade", value: data }), msgUpdateRecipe: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateRecipe", value: data }), + msgCompleteExecutionEarly: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", value: data }), + msgGoogleInAppPurchaseGetCoins: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", value: data }), + msgCreateAccount: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateAccount", value: data }), + msgTransferCookbook: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgTransferCookbook", value: data }), + msgCancelTrade: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCancelTrade", value: data }), msgExecuteRecipe: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgExecuteRecipe", value: data }), - msgCreateRecipe: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateRecipe", value: data }), msgUpdateCookbook: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateCookbook", value: data }), - msgUpdateAccount: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateAccount", value: data }), - msgCreateAccount: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateAccount", value: data }), + msgCreateTrade: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateTrade", value: data }), + msgCreateRecipe: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateRecipe", value: data }), + msgCreateCookbook: (data) => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateCookbook", value: data }), }; }; const queryClient = async ({ addr: addr } = { addr: "http://localhost:1317" }) => { diff --git a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.ts b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.ts index f24136660d..16563c0df9 100755 --- a/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.ts +++ b/vue/src/store/generated/Pylons-tech/pylons/Pylonstech.pylons.pylons/module/index.ts @@ -4,39 +4,39 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgFulfillTrade } from "./types/pylons/tx"; -import { MsgCompleteExecutionEarly } from "./types/pylons/tx"; -import { MsgCancelTrade } from "./types/pylons/tx"; import { MsgSetItemString } from "./types/pylons/tx"; -import { MsgCreateCookbook } from "./types/pylons/tx"; -import { MsgTransferCookbook } from "./types/pylons/tx"; -import { MsgGoogleInAppPurchaseGetCoins } from "./types/pylons/tx"; +import { MsgUpdateAccount } from "./types/pylons/tx"; import { MsgSendItems } from "./types/pylons/tx"; -import { MsgCreateTrade } from "./types/pylons/tx"; +import { MsgFulfillTrade } from "./types/pylons/tx"; import { MsgUpdateRecipe } from "./types/pylons/tx"; +import { MsgCompleteExecutionEarly } from "./types/pylons/tx"; +import { MsgGoogleInAppPurchaseGetCoins } from "./types/pylons/tx"; +import { MsgCreateAccount } from "./types/pylons/tx"; +import { MsgTransferCookbook } from "./types/pylons/tx"; +import { MsgCancelTrade } from "./types/pylons/tx"; import { MsgExecuteRecipe } from "./types/pylons/tx"; -import { MsgCreateRecipe } from "./types/pylons/tx"; import { MsgUpdateCookbook } from "./types/pylons/tx"; -import { MsgUpdateAccount } from "./types/pylons/tx"; -import { MsgCreateAccount } from "./types/pylons/tx"; +import { MsgCreateTrade } from "./types/pylons/tx"; +import { MsgCreateRecipe } from "./types/pylons/tx"; +import { MsgCreateCookbook } from "./types/pylons/tx"; const types = [ - ["/Pylonstech.pylons.pylons.MsgFulfillTrade", MsgFulfillTrade], - ["/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", MsgCompleteExecutionEarly], - ["/Pylonstech.pylons.pylons.MsgCancelTrade", MsgCancelTrade], ["/Pylonstech.pylons.pylons.MsgSetItemString", MsgSetItemString], - ["/Pylonstech.pylons.pylons.MsgCreateCookbook", MsgCreateCookbook], - ["/Pylonstech.pylons.pylons.MsgTransferCookbook", MsgTransferCookbook], - ["/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", MsgGoogleInAppPurchaseGetCoins], + ["/Pylonstech.pylons.pylons.MsgUpdateAccount", MsgUpdateAccount], ["/Pylonstech.pylons.pylons.MsgSendItems", MsgSendItems], - ["/Pylonstech.pylons.pylons.MsgCreateTrade", MsgCreateTrade], + ["/Pylonstech.pylons.pylons.MsgFulfillTrade", MsgFulfillTrade], ["/Pylonstech.pylons.pylons.MsgUpdateRecipe", MsgUpdateRecipe], + ["/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", MsgCompleteExecutionEarly], + ["/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", MsgGoogleInAppPurchaseGetCoins], + ["/Pylonstech.pylons.pylons.MsgCreateAccount", MsgCreateAccount], + ["/Pylonstech.pylons.pylons.MsgTransferCookbook", MsgTransferCookbook], + ["/Pylonstech.pylons.pylons.MsgCancelTrade", MsgCancelTrade], ["/Pylonstech.pylons.pylons.MsgExecuteRecipe", MsgExecuteRecipe], - ["/Pylonstech.pylons.pylons.MsgCreateRecipe", MsgCreateRecipe], ["/Pylonstech.pylons.pylons.MsgUpdateCookbook", MsgUpdateCookbook], - ["/Pylonstech.pylons.pylons.MsgUpdateAccount", MsgUpdateAccount], - ["/Pylonstech.pylons.pylons.MsgCreateAccount", MsgCreateAccount], + ["/Pylonstech.pylons.pylons.MsgCreateTrade", MsgCreateTrade], + ["/Pylonstech.pylons.pylons.MsgCreateRecipe", MsgCreateRecipe], + ["/Pylonstech.pylons.pylons.MsgCreateCookbook", MsgCreateCookbook], ]; export const MissingWalletError = new Error("wallet is required"); @@ -65,21 +65,21 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgFulfillTrade: (data: MsgFulfillTrade): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgFulfillTrade", value: data }), - msgCompleteExecutionEarly: (data: MsgCompleteExecutionEarly): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", value: data }), - msgCancelTrade: (data: MsgCancelTrade): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCancelTrade", value: data }), msgSetItemString: (data: MsgSetItemString): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgSetItemString", value: data }), - msgCreateCookbook: (data: MsgCreateCookbook): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateCookbook", value: data }), - msgTransferCookbook: (data: MsgTransferCookbook): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgTransferCookbook", value: data }), - msgGoogleInAppPurchaseGetCoins: (data: MsgGoogleInAppPurchaseGetCoins): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", value: data }), + msgUpdateAccount: (data: MsgUpdateAccount): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateAccount", value: data }), msgSendItems: (data: MsgSendItems): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgSendItems", value: data }), - msgCreateTrade: (data: MsgCreateTrade): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateTrade", value: data }), + msgFulfillTrade: (data: MsgFulfillTrade): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgFulfillTrade", value: data }), msgUpdateRecipe: (data: MsgUpdateRecipe): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateRecipe", value: data }), + msgCompleteExecutionEarly: (data: MsgCompleteExecutionEarly): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCompleteExecutionEarly", value: data }), + msgGoogleInAppPurchaseGetCoins: (data: MsgGoogleInAppPurchaseGetCoins): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgGoogleInAppPurchaseGetCoins", value: data }), + msgCreateAccount: (data: MsgCreateAccount): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateAccount", value: data }), + msgTransferCookbook: (data: MsgTransferCookbook): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgTransferCookbook", value: data }), + msgCancelTrade: (data: MsgCancelTrade): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCancelTrade", value: data }), msgExecuteRecipe: (data: MsgExecuteRecipe): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgExecuteRecipe", value: data }), - msgCreateRecipe: (data: MsgCreateRecipe): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateRecipe", value: data }), msgUpdateCookbook: (data: MsgUpdateCookbook): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateCookbook", value: data }), - msgUpdateAccount: (data: MsgUpdateAccount): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgUpdateAccount", value: data }), - msgCreateAccount: (data: MsgCreateAccount): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateAccount", value: data }), + msgCreateTrade: (data: MsgCreateTrade): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateTrade", value: data }), + msgCreateRecipe: (data: MsgCreateRecipe): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateRecipe", value: data }), + msgCreateCookbook: (data: MsgCreateCookbook): EncodeObject => ({ typeUrl: "/Pylonstech.pylons.pylons.MsgCreateCookbook", value: data }), }; }; diff --git a/x/pylons/client/cli/cli_test.go b/x/pylons/client/cli/cli_test.go index d10c8ec0df..b50c6150a8 100644 --- a/x/pylons/client/cli/cli_test.go +++ b/x/pylons/client/cli/cli_test.go @@ -51,9 +51,11 @@ func networkWithTradeObjects(t *testing.T, n int) (*network.Network, []types.Tra state := types.GenesisState{} require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + addresses := types.GenTestBech32List(n) + for i := 0; i < n; i++ { state.TradeList = append(state.TradeList, types.Trade{ - Creator: "creator", + Creator: addresses[i], ID: uint64(i), CoinInputs: []types.CoinInput{{Coins: sdk.NewCoins()}}, ItemInputs: make([]types.ItemInput, 0), diff --git a/x/pylons/client/cli/tx_fulfill_trade_test.go b/x/pylons/client/cli/tx_fulfill_trade_test.go index 0d26728d01..313ec3c686 100644 --- a/x/pylons/client/cli/tx_fulfill_trade_test.go +++ b/x/pylons/client/cli/tx_fulfill_trade_test.go @@ -1,3 +1,378 @@ package cli_test -// TODO add tests +import ( + "encoding/json" + "fmt" + "strconv" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/client" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/Pylons-tech/pylons/testutil/network" + "github.com/Pylons-tech/pylons/x/pylons/client/cli" + "github.com/Pylons-tech/pylons/x/pylons/types" +) + +type tradeSimInfo struct { + net *network.Network + ctx client.Context + basicTradePercentage sdk.Dec + err error + traderCommon []string + fulfillerCommon []string + execCount int + itemCount int + cookbookID string + getCoinRecipeID string +} + +func createGetTestCoinsRecipe(t *testing.T, simInfo *tradeSimInfo) { + denom := "testCoin" + entries, err := json.Marshal(types.EntriesList{ + CoinOutputs: []types.CoinOutput{{ + ID: "testCoin", + Coin: sdk.Coin{Denom: denom, Amount: sdk.NewInt(10000)}, + }}, + ItemOutputs: nil, + ItemModifyOutputs: nil, + }) + require.NoError(t, err) + + outputs, err := json.Marshal([]types.WeightedOutputs{ + { + EntryIDs: []string{"testCoin"}, + Weight: 1, + }, + }) + + // Get Character Recipe + simInfo.getCoinRecipeID = "getTestCoins" + getCoinRecipe := []string{ + "TEST-get-coins", + "Gives an account 10000 testCoin", + "v0.0.1", + "[]", + "[]", + string(entries), + string(outputs), + "0", + "true", + "extraInfo", + } + + // create recipe + args := []string{simInfo.cookbookID, simInfo.getCoinRecipeID} + args = append(args, getCoinRecipe...) + args = append(args, simInfo.traderCommon...) + _, err = clitestutil.ExecTestCLICmd(simInfo.ctx, cli.CmdCreateRecipe(), args) + require.NoError(t, err) +} + +func getTestCoins(t *testing.T, simInfo *tradeSimInfo, common []string) { + // execute recipe + args := []string{simInfo.cookbookID, simInfo.getCoinRecipeID, "0", "[]"} // empty list for item-ids since there is no item input + args = append(args, common...) + out, err := clitestutil.ExecTestCLICmd(simInfo.ctx, cli.CmdExecuteRecipe(), args) + require.NoError(t, err) + var resp sdk.TxResponse + require.NoError(t, simInfo.ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, uint32(0), resp.Code) + + // simulate waiting for later block heights + height, err := simInfo.net.LatestHeight() + targetHeight := height + 1 + // build execID from the execution height + execID := strconv.Itoa(int(height+0)) + "-" + strconv.Itoa(simInfo.execCount) + simInfo.execCount++ + require.NoError(t, err) + _, err = simInfo.net.WaitForHeightWithTimeout(targetHeight, 60*time.Second) + require.NoError(t, err) + + // check the execution + args = []string{execID} + out, err = clitestutil.ExecTestCLICmd(simInfo.ctx, cli.CmdShowExecution(), args) + require.NoError(t, err) + var execResp types.QueryGetExecutionResponse + require.NoError(t, simInfo.ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &execResp)) + // verify completed + require.Equal(t, true, execResp.Completed) + + // TODO check balance? +} + +func TestFulfillTradeItemForCoins(t *testing.T) { + net := network.New(t) + val := net.Validators[0] + ctx := val.ClientCtx + var err error + + accs := generateAddressesInKeyring(val.ClientCtx.Keyring, 1) + trader := accs[0] + traderUsername := "trader" + + fulFillercommon := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), + } + + traderCommon := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, trader.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), + } + + cookbookID := "testCookbookID" + itemRecipeID := "itemRecipeID" + + simInfo := &tradeSimInfo{ + net: net, + ctx: val.ClientCtx, + basicTradePercentage: sdk.Dec{}, + err: nil, + traderCommon: traderCommon, + fulfillerCommon: fulFillercommon, + execCount: 0, + itemCount: 0, + cookbookID: cookbookID, + } + + simInfo.basicTradePercentage, err = sdk.NewDecFromStr("0.10") + require.NoError(t, err) + + // create account for trader + args := []string{traderUsername} + args = append(args, simInfo.traderCommon...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateAccount(), args) + require.NoError(t, err) + var resp sdk.TxResponse + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, uint32(0), resp.Code) + + // simulate full execution of recipe to generate an item + + cbFields := []string{ + "testCookbookName", + "DescriptionDescriptionDescription", + "Developer", + "v0.0.1", + "test@email.com", + "{\"denom\": \"node0token\", \"amount\": \"1\"}", + "true", + } + + tradePercentage, err := sdk.NewDecFromStr("0.01") + require.NoError(t, err) + + testDenom, err := types.CookbookDenom(simInfo.cookbookID, "testCoin") + require.NoError(t, err) + + entries, err := json.Marshal(types.EntriesList{ + CoinOutputs: nil, + ItemOutputs: []types.ItemOutput{ + { + ID: "testID", + Doubles: []types.DoubleParam{ + { + Key: "Mass", + Rate: sdk.OneDec(), + WeightRanges: []types.DoubleWeightRange{ + { + Lower: sdk.NewDec(50), + Upper: sdk.NewDec(100), + Weight: 1, + }, + }, + Program: "", + }, + }, + Longs: nil, + Strings: []types.StringParam{ + { + Key: "testKey", + Rate: sdk.OneDec(), + Value: "testValue", + Program: "", + }, + }, + MutableStrings: nil, + TransferFee: []sdk.Coin{sdk.NewCoin(testDenom, sdk.NewInt(10))}, + TradePercentage: tradePercentage, + Quantity: 0, + AmountMinted: 0, + Tradeable: true, + }, + }, + ItemModifyOutputs: nil, + }) + require.NoError(t, err) + + itemOutputs, err := json.Marshal([]types.WeightedOutputs{ + { + EntryIDs: []string{"testID"}, + Weight: 1, + }, + }) + require.NoError(t, err) + + recipeFields := []string{ + "testRecipeName", + "DescriptionDescriptionDescriptionDescription", + "v0.0.1", + "[]", + "[]", + string(entries), + string(itemOutputs), + "0", + "true", + "extraInfo", + } + + // create cookbook + args = []string{cookbookID} + args = append(args, cbFields...) + args = append(args, simInfo.traderCommon...) + _, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateCookbook(), args) + require.NoError(t, err) + + createGetTestCoinsRecipe(t, simInfo) + + // create recipe + args = []string{cookbookID, itemRecipeID} + args = append(args, recipeFields...) + args = append(args, simInfo.traderCommon...) + _, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateRecipe(), args) + require.NoError(t, err) + + // create execution + args = []string{cookbookID, itemRecipeID, "0", "[]"} // empty list for item-ids since there is no item input + args = append(args, simInfo.traderCommon...) + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdExecuteRecipe(), args) + require.NoError(t, err) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, uint32(0), resp.Code) + + // simulate waiting for later block heights + height, err := net.LatestHeight() + targetHeight := height + 1 + // build execID from the execution height + execID := strconv.Itoa(int(height+0)) + "-" + strconv.Itoa(simInfo.execCount) + simInfo.execCount++ + require.NoError(t, err) + _, err = net.WaitForHeightWithTimeout(targetHeight, 60*time.Second) + require.NoError(t, err) + + // check the execution + args = []string{execID} + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdShowExecution(), args) + require.NoError(t, err) + var execResp types.QueryGetExecutionResponse + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &execResp)) + // verify completed + require.Equal(t, true, execResp.Completed) + + // check the item, itemID is i + itemID := types.EncodeItemID(uint64(0)) + args = []string{cookbookID, itemID} + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdShowItem(), args) + require.NoError(t, err) + var itemResp types.QueryGetItemResponse + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &itemResp)) + require.Equal(t, cookbookID, itemResp.Item.CookbookID) + require.Equal(t, height, itemResp.Item.LastUpdate) + + // no coinInputs + coinInputs, err := json.Marshal([]types.CoinInput{ + { + Coins: sdk.NewCoins(sdk.NewCoin(testDenom, sdk.NewInt(110))), + }, + }) + require.NoError(t, err) + + // no item input + itemInputs, err := json.Marshal([]types.ItemInput{}) + require.NoError(t, err) + + // no coinOutputs + coinOutputs, err := json.Marshal(sdk.Coins{ + //sdk.NewCoin(testDenom, sdk.NewInt(10)), + }) + require.NoError(t, err) + + // no item outputs + itemOutputs, err = json.Marshal([]types.ItemRef{ + { + CookbookID: cookbookID, + ItemID: itemID, + }, + }) + require.NoError(t, err) + + // get some coins for trader + getTestCoins(t, simInfo, simInfo.traderCommon) + getTestCoins(t, simInfo, simInfo.fulfillerCommon) + + // coinInputs, itemInputs, coinOutputs, itemOutputs, extraInfo, flags + tradeFields := []string{ + string(coinInputs), + string(itemInputs), + string(coinOutputs), + string(itemOutputs), + "extraInfo", + } + + // create trade from trader + args = make([]string, 0) + args = append(args, tradeFields...) + args = append(args, simInfo.traderCommon...) + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateTrade(), args) + require.NoError(t, err) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, uint32(0), resp.Code) + + // fulfill trade from FULFILLER + // pylonsd tx pylons fulfill-trade [id] [coin-inputs-index] [items] [flags] + tradeID := 0 + coinIndex := 0 + items, err := json.Marshal([]types.ItemRef{}) + require.NoError(t, err) + + fulfillFields := []string{ + fmt.Sprintf("%d", tradeID), + fmt.Sprintf("%d", coinIndex), + string(items), + } + + args = make([]string, 0) + args = append(args, fulfillFields...) + args = append(args, simInfo.fulfillerCommon...) + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdFulfillTrade(), args) + require.NoError(t, err) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, uint32(0), resp.Code) + + // emsure that item is owned by FULFILLER + args = make([]string, 0) + args = append(args, val.Address.String()) + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdListItemByOwner(), args) + var listItemResp types.QueryListItemByOwnerResponse + require.NoError(t, err) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &listItemResp)) + require.Equal(t, 1, len(listItemResp.Items)) + + args = make([]string, 0) + args = append(args, trader.String()) + out, err = clitestutil.ExecTestCLICmd(ctx, cli.CmdListItemByOwner(), args) + require.NoError(t, err) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &listItemResp)) + require.Equal(t, 0, len(listItemResp.Items)) + +} diff --git a/x/pylons/client/cli/tx_trade_test.go b/x/pylons/client/cli/tx_trade_test.go index 1d721b2927..2e2b621c43 100644 --- a/x/pylons/client/cli/tx_trade_test.go +++ b/x/pylons/client/cli/tx_trade_test.go @@ -173,18 +173,6 @@ func TestCreateTradeItemOutput(t *testing.T) { }) require.NoError(t, err) - // test json unmarshalling of strings - argsEntries, err := cast.ToStringE(string(entries)) - require.NoError(t, err) - jsonArgsEntries := types.EntriesList{} - err = json.Unmarshal([]byte(argsEntries), &jsonArgsEntries) - require.NoError(t, err) - argsOutputs, err := cast.ToStringE(string(itemOutputs)) - require.NoError(t, err) - jsonArgsOutputs := make([]types.WeightedOutputs, 0) - err = json.Unmarshal([]byte(argsOutputs), &jsonArgsOutputs) - require.NoError(t, err) - recipeFields := []string{ "testRecipeName", "DescriptionDescriptionDescriptionDescription", diff --git a/x/pylons/keeper/msg_server_fulfill_trade.go b/x/pylons/keeper/msg_server_fulfill_trade.go index 591b2d8df0..7cf3a45da9 100644 --- a/x/pylons/keeper/msg_server_fulfill_trade.go +++ b/x/pylons/keeper/msg_server_fulfill_trade.go @@ -112,7 +112,7 @@ func (k msgServer) FulfillTrade(goCtx context.Context, msg *types.MsgFulfillTrad if err != nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "balance not sufficient to pay coinInputs") } - for i := range matchedInputItems { + for i := range outputItems { minItemOutputsTransferFees = minItemOutputsTransferFees.Add(outputItems[i].TransferFee[itemOutputsTransferFeePermutation[i]]) } diff --git a/x/pylons/types/item.go b/x/pylons/types/item.go index 454438d278..9334329540 100644 --- a/x/pylons/types/item.go +++ b/x/pylons/types/item.go @@ -313,6 +313,11 @@ func newPaymentsPermutation(permutation []int, val, maxIndex int) ([]int, int) { // When exploring the solution space the algorithm prioritizes the permutation where the max(permutation) is minimized. // For example, for a set of 3 items the permutation [1,0,2] is preferred to [3,0,0] if both are valid. func FindValidPaymentsPermutation(items []Item, balance sdk.Coins) ([]int, error) { + if len(items) == 0 && balance.Empty() { + ret := make([]int, 0) + return ret, nil + } + if len(items) == 0 { return nil, errors.New("invalid set of Items provided") }