Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/release distribution exchange examples #210

Merged
merged 10 commits into from
Mar 8, 2024
8 changes: 8 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
reviews:
auto_review:
base_branches:
- "master"
- "dev"
- "feat/.*"
chat:
auto_reply: true
104 changes: 104 additions & 0 deletions auth_vote/authz_vote.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package main

import (
"encoding/json"
"fmt"
"os"

"github.com/InjectiveLabs/sdk-go/client"
chainclient "github.com/InjectiveLabs/sdk-go/client/chain"
"github.com/InjectiveLabs/sdk-go/client/common"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authztypes "github.com/cosmos/cosmos-sdk/x/authz"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
)

func main() {
network := common.LoadNetwork("testnet", "lb")
tmClient, err := rpchttp.New(network.TmEndpoint, "/websocket")
if err != nil {
panic(err)
}

if err != nil {
panic(err)
}

senderAddress, cosmosKeyring, err := chainclient.InitCosmosKeyring(
os.Getenv("HOME")+"/.injectived",
"injectived",
"file",
"gov_account",
"",
"", // keyring will be used if pk not provided
false,
)

if err != nil {
panic(err)
}

clientCtx, err := chainclient.NewClientContext(
network.ChainId,
senderAddress.String(),
cosmosKeyring,
)

if err != nil {
panic(err)
}

clientCtx = clientCtx.WithNodeURI(network.TmEndpoint).WithClient(tmClient)

txFactory := chainclient.NewTxFactory(clientCtx)
txFactory = txFactory.WithGasPrices(client.DefaultGasPriceWithDenom)
chainClient, err := chainclient.NewChainClient(
clientCtx,
network,
common.OptionTxFactory(&txFactory),
)

if err != nil {
panic(err)
}

// note that we use grantee keyring to send the msg on behalf of granter here
// sender, subaccount are from granter
validators := []string{"inj156t3yxd4udv0h9gwagfcmwnmm3quy0npqc7pks", "inj16nd8yqxe9p6ggnrz58qr7dxn5y2834yendward"}
grantee := senderAddress.String()
proposalId := uint64(375)
var msgs []sdk.Msg

for _, validator := range validators {
msgVote := v1beta1.MsgVote{
ProposalId: proposalId,
Voter: validator,
Option: v1beta1.OptionYes,
}

msg0Bytes, _ := msgVote.Marshal()
msg0Any := &codectypes.Any{}
msg0Any.TypeUrl = sdk.MsgTypeURL(&msgVote)
msg0Any.Value = msg0Bytes

msg := &authztypes.MsgExec{
Grantee: grantee,
Msgs: []*codectypes.Any{msg0Any},
}

sdkMsg := sdk.Msg(msg)
msgs = append(msgs, sdkMsg)
}

//AsyncBroadcastMsg, SyncBroadcastMsg, QueueBroadcastMsg
response, err := chainClient.AsyncBroadcastMsg(msgs...)

if err != nil {
panic(err)
}

str, _ := json.MarshalIndent(response, "", " ")
fmt.Print(string(str))
Comment on lines +18 to +103
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the auth_vote/authz_vote.go file, the error handling after the JSON marshalling operation (line 102) is missing. Proper error handling is essential for catching any issues that may occur during the marshalling process, which can help in debugging and ensuring the program's robustness.

- str, _ := json.MarshalIndent(response, "", " ")
+ str, err := json.MarshalIndent(response, "", " ")
+ if err != nil {
+     fmt.Println("Error marshalling JSON:", err)
+     return
+ }

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
func main() {
network := common.LoadNetwork("testnet", "lb")
tmClient, err := rpchttp.New(network.TmEndpoint, "/websocket")
if err != nil {
panic(err)
}
if err != nil {
panic(err)
}
senderAddress, cosmosKeyring, err := chainclient.InitCosmosKeyring(
os.Getenv("HOME")+"/.injectived",
"injectived",
"file",
"gov_account",
"",
"", // keyring will be used if pk not provided
false,
)
if err != nil {
panic(err)
}
clientCtx, err := chainclient.NewClientContext(
network.ChainId,
senderAddress.String(),
cosmosKeyring,
)
if err != nil {
panic(err)
}
clientCtx = clientCtx.WithNodeURI(network.TmEndpoint).WithClient(tmClient)
txFactory := chainclient.NewTxFactory(clientCtx)
txFactory = txFactory.WithGasPrices(client.DefaultGasPriceWithDenom)
chainClient, err := chainclient.NewChainClient(
clientCtx,
network,
common.OptionTxFactory(&txFactory),
)
if err != nil {
panic(err)
}
// note that we use grantee keyring to send the msg on behalf of granter here
// sender, subaccount are from granter
validators := []string{"inj156t3yxd4udv0h9gwagfcmwnmm3quy0npqc7pks", "inj16nd8yqxe9p6ggnrz58qr7dxn5y2834yendward"}
grantee := senderAddress.String()
proposalId := uint64(375)
var msgs []sdk.Msg
for _, validator := range validators {
msgVote := v1beta1.MsgVote{
ProposalId: proposalId,
Voter: validator,
Option: v1beta1.OptionYes,
}
msg0Bytes, _ := msgVote.Marshal()
msg0Any := &codectypes.Any{}
msg0Any.TypeUrl = sdk.MsgTypeURL(&msgVote)
msg0Any.Value = msg0Bytes
msg := &authztypes.MsgExec{
Grantee: grantee,
Msgs: []*codectypes.Any{msg0Any},
}
sdkMsg := sdk.Msg(msg)
msgs = append(msgs, sdkMsg)
}
//AsyncBroadcastMsg, SyncBroadcastMsg, QueueBroadcastMsg
response, err := chainClient.AsyncBroadcastMsg(msgs...)
if err != nil {
panic(err)
}
str, _ := json.MarshalIndent(response, "", " ")
fmt.Print(string(str))
str, err := json.MarshalIndent(response, "", " ")
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
fmt.Print(string(str))

}
575 changes: 549 additions & 26 deletions client/chain/chain.go

Large diffs are not rendered by default.

260 changes: 260 additions & 0 deletions client/chain/chain_test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"errors"
"time"

distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"

tokenfactorytypes "github.com/InjectiveLabs/sdk-go/chain/tokenfactory/types"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
Expand Down Expand Up @@ -286,3 +288,261 @@
func (c *MockChainClient) FetchTokenfactoryModuleState(ctx context.Context) (*tokenfactorytypes.QueryModuleStateResponse, error) {
return &tokenfactorytypes.QueryModuleStateResponse{}, nil
}

// Distribution module
func (c *MockChainClient) FetchValidatorDistributionInfo(ctx context.Context, validatorAddress string) (*distributiontypes.QueryValidatorDistributionInfoResponse, error) {
return &distributiontypes.QueryValidatorDistributionInfoResponse{}, nil

Check warning on line 294 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L293-L294

Added lines #L293 - L294 were not covered by tests
}

func (c *MockChainClient) FetchValidatorOutstandingRewards(ctx context.Context, validatorAddress string) (*distributiontypes.QueryValidatorOutstandingRewardsResponse, error) {
return &distributiontypes.QueryValidatorOutstandingRewardsResponse{}, nil

Check warning on line 298 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L297-L298

Added lines #L297 - L298 were not covered by tests
}

func (c *MockChainClient) FetchValidatorCommission(ctx context.Context, validatorAddress string) (*distributiontypes.QueryValidatorCommissionResponse, error) {
return &distributiontypes.QueryValidatorCommissionResponse{}, nil

Check warning on line 302 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L301-L302

Added lines #L301 - L302 were not covered by tests
}

func (c *MockChainClient) FetchValidatorSlashes(ctx context.Context, validatorAddress string, startingHeight uint64, endingHeight uint64, pagination *query.PageRequest) (*distributiontypes.QueryValidatorSlashesResponse, error) {
return &distributiontypes.QueryValidatorSlashesResponse{}, nil

Check warning on line 306 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L305-L306

Added lines #L305 - L306 were not covered by tests
}

func (c *MockChainClient) FetchDelegationRewards(ctx context.Context, delegatorAddress string, validatorAddress string) (*distributiontypes.QueryDelegationRewardsResponse, error) {
return &distributiontypes.QueryDelegationRewardsResponse{}, nil

Check warning on line 310 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L309-L310

Added lines #L309 - L310 were not covered by tests
}

func (c *MockChainClient) FetchDelegationTotalRewards(ctx context.Context, delegatorAddress string) (*distributiontypes.QueryDelegationTotalRewardsResponse, error) {
return &distributiontypes.QueryDelegationTotalRewardsResponse{}, nil

Check warning on line 314 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L313-L314

Added lines #L313 - L314 were not covered by tests
}

func (c *MockChainClient) FetchDelegatorValidators(ctx context.Context, delegatorAddress string) (*distributiontypes.QueryDelegatorValidatorsResponse, error) {
return &distributiontypes.QueryDelegatorValidatorsResponse{}, nil

Check warning on line 318 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L317-L318

Added lines #L317 - L318 were not covered by tests
}

func (c *MockChainClient) FetchDelegatorWithdrawAddress(ctx context.Context, delegatorAddress string) (*distributiontypes.QueryDelegatorWithdrawAddressResponse, error) {
return &distributiontypes.QueryDelegatorWithdrawAddressResponse{}, nil

Check warning on line 322 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L321-L322

Added lines #L321 - L322 were not covered by tests
}

func (c *MockChainClient) FetchCommunityPool(ctx context.Context) (*distributiontypes.QueryCommunityPoolResponse, error) {
return &distributiontypes.QueryCommunityPoolResponse{}, nil

Check warning on line 326 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L325-L326

Added lines #L325 - L326 were not covered by tests
}

// Chain exchange module
func (c *MockChainClient) FetchSubaccountDeposits(ctx context.Context, subaccountId string) (*exchangetypes.QuerySubaccountDepositsResponse, error) {
return &exchangetypes.QuerySubaccountDepositsResponse{}, nil

Check warning on line 331 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L330-L331

Added lines #L330 - L331 were not covered by tests
}

func (c *MockChainClient) FetchSubaccountDeposit(ctx context.Context, subaccountId string, denom string) (*exchangetypes.QuerySubaccountDepositResponse, error) {
return &exchangetypes.QuerySubaccountDepositResponse{}, nil

Check warning on line 335 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L334-L335

Added lines #L334 - L335 were not covered by tests
}

func (c *MockChainClient) FetchExchangeBalances(ctx context.Context) (*exchangetypes.QueryExchangeBalancesResponse, error) {
return &exchangetypes.QueryExchangeBalancesResponse{}, nil

Check warning on line 339 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L338-L339

Added lines #L338 - L339 were not covered by tests
}

func (c *MockChainClient) FetchAggregateVolume(ctx context.Context, account string) (*exchangetypes.QueryAggregateVolumeResponse, error) {
return &exchangetypes.QueryAggregateVolumeResponse{}, nil

Check warning on line 343 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L342-L343

Added lines #L342 - L343 were not covered by tests
}

func (c *MockChainClient) FetchAggregateVolumes(ctx context.Context, accounts []string, marketIds []string) (*exchangetypes.QueryAggregateVolumesResponse, error) {
return &exchangetypes.QueryAggregateVolumesResponse{}, nil

Check warning on line 347 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L346-L347

Added lines #L346 - L347 were not covered by tests
}

func (c *MockChainClient) FetchAggregateMarketVolume(ctx context.Context, marketId string) (*exchangetypes.QueryAggregateMarketVolumeResponse, error) {
return &exchangetypes.QueryAggregateMarketVolumeResponse{}, nil

Check warning on line 351 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L350-L351

Added lines #L350 - L351 were not covered by tests
}

func (c *MockChainClient) FetchAggregateMarketVolumes(ctx context.Context, marketIds []string) (*exchangetypes.QueryAggregateMarketVolumesResponse, error) {
return &exchangetypes.QueryAggregateMarketVolumesResponse{}, nil

Check warning on line 355 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L354-L355

Added lines #L354 - L355 were not covered by tests
}

func (c *MockChainClient) FetchDenomDecimal(ctx context.Context, denom string) (*exchangetypes.QueryDenomDecimalResponse, error) {
return &exchangetypes.QueryDenomDecimalResponse{}, nil

Check warning on line 359 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L358-L359

Added lines #L358 - L359 were not covered by tests
}

func (c *MockChainClient) FetchDenomDecimals(ctx context.Context, denoms []string) (*exchangetypes.QueryDenomDecimalsResponse, error) {
return &exchangetypes.QueryDenomDecimalsResponse{}, nil

Check warning on line 363 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L362-L363

Added lines #L362 - L363 were not covered by tests
}

func (c *MockChainClient) FetchChainSpotMarkets(ctx context.Context, status string, marketIds []string) (*exchangetypes.QuerySpotMarketsResponse, error) {
return &exchangetypes.QuerySpotMarketsResponse{}, nil

Check warning on line 367 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L366-L367

Added lines #L366 - L367 were not covered by tests
}

func (c *MockChainClient) FetchChainSpotMarket(ctx context.Context, marketId string) (*exchangetypes.QuerySpotMarketResponse, error) {
return &exchangetypes.QuerySpotMarketResponse{}, nil

Check warning on line 371 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L370-L371

Added lines #L370 - L371 were not covered by tests
}

func (c *MockChainClient) FetchChainFullSpotMarkets(ctx context.Context, status string, marketIds []string, withMidPriceAndTob bool) (*exchangetypes.QueryFullSpotMarketsResponse, error) {
return &exchangetypes.QueryFullSpotMarketsResponse{}, nil

Check warning on line 375 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L374-L375

Added lines #L374 - L375 were not covered by tests
}

func (c *MockChainClient) FetchChainFullSpotMarket(ctx context.Context, marketId string, withMidPriceAndTob bool) (*exchangetypes.QueryFullSpotMarketResponse, error) {
return &exchangetypes.QueryFullSpotMarketResponse{}, nil

Check warning on line 379 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L378-L379

Added lines #L378 - L379 were not covered by tests
}

func (c *MockChainClient) FetchChainSpotOrderbook(ctx context.Context, marketId string, limit uint64, orderSide exchangetypes.OrderSide, limitCumulativeNotional sdk.Dec, limitCumulativeQuantity sdk.Dec) (*exchangetypes.QuerySpotOrderbookResponse, error) {
return &exchangetypes.QuerySpotOrderbookResponse{}, nil

Check warning on line 383 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L382-L383

Added lines #L382 - L383 were not covered by tests
}

func (c *MockChainClient) FetchChainTraderSpotOrders(ctx context.Context, marketId string, subaccountId string) (*exchangetypes.QueryTraderSpotOrdersResponse, error) {
return &exchangetypes.QueryTraderSpotOrdersResponse{}, nil

Check warning on line 387 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L386-L387

Added lines #L386 - L387 were not covered by tests
}

func (c *MockChainClient) FetchChainAccountAddressSpotOrders(ctx context.Context, marketId string, address string) (*exchangetypes.QueryAccountAddressSpotOrdersResponse, error) {
return &exchangetypes.QueryAccountAddressSpotOrdersResponse{}, nil

Check warning on line 391 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L390-L391

Added lines #L390 - L391 were not covered by tests
}

func (c *MockChainClient) FetchChainSpotOrdersByHashes(ctx context.Context, marketId string, subaccountId string, orderHashes []string) (*exchangetypes.QuerySpotOrdersByHashesResponse, error) {
return &exchangetypes.QuerySpotOrdersByHashesResponse{}, nil

Check warning on line 395 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L394-L395

Added lines #L394 - L395 were not covered by tests
}

func (c *MockChainClient) FetchChainSubaccountOrders(ctx context.Context, subaccountId string, marketId string) (*exchangetypes.QuerySubaccountOrdersResponse, error) {
return &exchangetypes.QuerySubaccountOrdersResponse{}, nil

Check warning on line 399 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L398-L399

Added lines #L398 - L399 were not covered by tests
}

func (c *MockChainClient) FetchChainTraderSpotTransientOrders(ctx context.Context, marketId string, subaccountId string) (*exchangetypes.QueryTraderSpotOrdersResponse, error) {
return &exchangetypes.QueryTraderSpotOrdersResponse{}, nil

Check warning on line 403 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L402-L403

Added lines #L402 - L403 were not covered by tests
}

func (c *MockChainClient) FetchSpotMidPriceAndTOB(ctx context.Context, marketId string) (*exchangetypes.QuerySpotMidPriceAndTOBResponse, error) {
return &exchangetypes.QuerySpotMidPriceAndTOBResponse{}, nil

Check warning on line 407 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L406-L407

Added lines #L406 - L407 were not covered by tests
}

func (c *MockChainClient) FetchDerivativeMidPriceAndTOB(ctx context.Context, marketId string) (*exchangetypes.QueryDerivativeMidPriceAndTOBResponse, error) {
return &exchangetypes.QueryDerivativeMidPriceAndTOBResponse{}, nil

Check warning on line 411 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L410-L411

Added lines #L410 - L411 were not covered by tests
}

func (c *MockChainClient) FetchChainDerivativeOrderbook(ctx context.Context, marketId string, limit uint64, limitCumulativeNotional sdk.Dec) (*exchangetypes.QueryDerivativeOrderbookResponse, error) {
return &exchangetypes.QueryDerivativeOrderbookResponse{}, nil

Check warning on line 415 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L414-L415

Added lines #L414 - L415 were not covered by tests
}

func (c *MockChainClient) FetchChainTraderDerivativeOrders(ctx context.Context, marketId string, subaccountId string) (*exchangetypes.QueryTraderDerivativeOrdersResponse, error) {
return &exchangetypes.QueryTraderDerivativeOrdersResponse{}, nil

Check warning on line 419 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L418-L419

Added lines #L418 - L419 were not covered by tests
}

func (c *MockChainClient) FetchChainAccountAddressDerivativeOrders(ctx context.Context, marketId string, address string) (*exchangetypes.QueryAccountAddressDerivativeOrdersResponse, error) {
return &exchangetypes.QueryAccountAddressDerivativeOrdersResponse{}, nil

Check warning on line 423 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L422-L423

Added lines #L422 - L423 were not covered by tests
}

func (c *MockChainClient) FetchChainDerivativeOrdersByHashes(ctx context.Context, marketId string, subaccountId string, orderHashes []string) (*exchangetypes.QueryDerivativeOrdersByHashesResponse, error) {
return &exchangetypes.QueryDerivativeOrdersByHashesResponse{}, nil

Check warning on line 427 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L426-L427

Added lines #L426 - L427 were not covered by tests
}

func (c *MockChainClient) FetchChainTraderDerivativeTransientOrders(ctx context.Context, marketId string, subaccountId string) (*exchangetypes.QueryTraderDerivativeOrdersResponse, error) {
return &exchangetypes.QueryTraderDerivativeOrdersResponse{}, nil

Check warning on line 431 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L430-L431

Added lines #L430 - L431 were not covered by tests
}

func (c *MockChainClient) FetchChainDerivativeMarkets(ctx context.Context, status string, marketIds []string, withMidPriceAndTob bool) (*exchangetypes.QueryDerivativeMarketsResponse, error) {
return &exchangetypes.QueryDerivativeMarketsResponse{}, nil

Check warning on line 435 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L434-L435

Added lines #L434 - L435 were not covered by tests
}

func (c *MockChainClient) FetchChainDerivativeMarket(ctx context.Context, marketId string) (*exchangetypes.QueryDerivativeMarketResponse, error) {
return &exchangetypes.QueryDerivativeMarketResponse{}, nil

Check warning on line 439 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L438-L439

Added lines #L438 - L439 were not covered by tests
}

func (c *MockChainClient) FetchDerivativeMarketAddress(ctx context.Context, marketId string) (*exchangetypes.QueryDerivativeMarketAddressResponse, error) {
return &exchangetypes.QueryDerivativeMarketAddressResponse{}, nil

Check warning on line 443 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L442-L443

Added lines #L442 - L443 were not covered by tests
}

func (c *MockChainClient) FetchSubaccountTradeNonce(ctx context.Context, subaccountId string) (*exchangetypes.QuerySubaccountTradeNonceResponse, error) {
return &exchangetypes.QuerySubaccountTradeNonceResponse{}, nil

Check warning on line 447 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L446-L447

Added lines #L446 - L447 were not covered by tests
}

func (c *MockChainClient) FetchChainPositions(ctx context.Context) (*exchangetypes.QueryPositionsResponse, error) {
return &exchangetypes.QueryPositionsResponse{}, nil

Check warning on line 451 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L450-L451

Added lines #L450 - L451 were not covered by tests
}

func (c *MockChainClient) FetchChainSubaccountPositions(ctx context.Context, subaccountId string) (*exchangetypes.QuerySubaccountPositionsResponse, error) {
return &exchangetypes.QuerySubaccountPositionsResponse{}, nil

Check warning on line 455 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L454-L455

Added lines #L454 - L455 were not covered by tests
}

func (c *MockChainClient) FetchChainSubaccountPositionInMarket(ctx context.Context, subaccountId string, marketId string) (*exchangetypes.QuerySubaccountPositionInMarketResponse, error) {
return &exchangetypes.QuerySubaccountPositionInMarketResponse{}, nil

Check warning on line 459 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L458-L459

Added lines #L458 - L459 were not covered by tests
}

func (c *MockChainClient) FetchChainSubaccountEffectivePositionInMarket(ctx context.Context, subaccountId string, marketId string) (*exchangetypes.QuerySubaccountEffectivePositionInMarketResponse, error) {
return &exchangetypes.QuerySubaccountEffectivePositionInMarketResponse{}, nil

Check warning on line 463 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L462-L463

Added lines #L462 - L463 were not covered by tests
}

func (c *MockChainClient) FetchChainPerpetualMarketInfo(ctx context.Context, marketId string) (*exchangetypes.QueryPerpetualMarketInfoResponse, error) {
return &exchangetypes.QueryPerpetualMarketInfoResponse{}, nil

Check warning on line 467 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L466-L467

Added lines #L466 - L467 were not covered by tests
}

func (c *MockChainClient) FetchChainExpiryFuturesMarketInfo(ctx context.Context, marketId string) (*exchangetypes.QueryExpiryFuturesMarketInfoResponse, error) {
return &exchangetypes.QueryExpiryFuturesMarketInfoResponse{}, nil

Check warning on line 471 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L470-L471

Added lines #L470 - L471 were not covered by tests
}

func (c *MockChainClient) FetchChainPerpetualMarketFunding(ctx context.Context, marketId string) (*exchangetypes.QueryPerpetualMarketFundingResponse, error) {
return &exchangetypes.QueryPerpetualMarketFundingResponse{}, nil

Check warning on line 475 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L474-L475

Added lines #L474 - L475 were not covered by tests
}

func (c *MockChainClient) FetchSubaccountOrderMetadata(ctx context.Context, subaccountId string) (*exchangetypes.QuerySubaccountOrderMetadataResponse, error) {
return &exchangetypes.QuerySubaccountOrderMetadataResponse{}, nil

Check warning on line 479 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L478-L479

Added lines #L478 - L479 were not covered by tests
}

func (c *MockChainClient) FetchTradeRewardPoints(ctx context.Context, accounts []string) (*exchangetypes.QueryTradeRewardPointsResponse, error) {
return &exchangetypes.QueryTradeRewardPointsResponse{}, nil

Check warning on line 483 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L482-L483

Added lines #L482 - L483 were not covered by tests
}

func (c *MockChainClient) FetchPendingTradeRewardPoints(ctx context.Context, accounts []string) (*exchangetypes.QueryTradeRewardPointsResponse, error) {
return &exchangetypes.QueryTradeRewardPointsResponse{}, nil

Check warning on line 487 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L486-L487

Added lines #L486 - L487 were not covered by tests
}

func (c *MockChainClient) FetchTradeRewardCampaign(ctx context.Context) (*exchangetypes.QueryTradeRewardCampaignResponse, error) {
return &exchangetypes.QueryTradeRewardCampaignResponse{}, nil

Check warning on line 491 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L490-L491

Added lines #L490 - L491 were not covered by tests
}

func (c *MockChainClient) FetchFeeDiscountAccountInfo(ctx context.Context, account string) (*exchangetypes.QueryFeeDiscountAccountInfoResponse, error) {
return &exchangetypes.QueryFeeDiscountAccountInfoResponse{}, nil

Check warning on line 495 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L494-L495

Added lines #L494 - L495 were not covered by tests
}

func (c *MockChainClient) FetchFeeDiscountSchedule(ctx context.Context) (*exchangetypes.QueryFeeDiscountScheduleResponse, error) {
return &exchangetypes.QueryFeeDiscountScheduleResponse{}, nil

Check warning on line 499 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L498-L499

Added lines #L498 - L499 were not covered by tests
}

func (c *MockChainClient) FetchBalanceMismatches(ctx context.Context, dustFactor int64) (*exchangetypes.QueryBalanceMismatchesResponse, error) {
return &exchangetypes.QueryBalanceMismatchesResponse{}, nil

Check warning on line 503 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L502-L503

Added lines #L502 - L503 were not covered by tests
}

func (c *MockChainClient) FetchBalanceWithBalanceHolds(ctx context.Context) (*exchangetypes.QueryBalanceWithBalanceHoldsResponse, error) {
return &exchangetypes.QueryBalanceWithBalanceHoldsResponse{}, nil

Check warning on line 507 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L506-L507

Added lines #L506 - L507 were not covered by tests
}

func (c *MockChainClient) FetchFeeDiscountTierStatistics(ctx context.Context) (*exchangetypes.QueryFeeDiscountTierStatisticsResponse, error) {
return &exchangetypes.QueryFeeDiscountTierStatisticsResponse{}, nil

Check warning on line 511 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L510-L511

Added lines #L510 - L511 were not covered by tests
}

func (c *MockChainClient) FetchMitoVaultInfos(ctx context.Context) (*exchangetypes.MitoVaultInfosResponse, error) {
return &exchangetypes.MitoVaultInfosResponse{}, nil

Check warning on line 515 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L514-L515

Added lines #L514 - L515 were not covered by tests
}

func (c *MockChainClient) FetchMarketIDFromVault(ctx context.Context, vaultAddress string) (*exchangetypes.QueryMarketIDFromVaultResponse, error) {
return &exchangetypes.QueryMarketIDFromVaultResponse{}, nil

Check warning on line 519 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L518-L519

Added lines #L518 - L519 were not covered by tests
}

func (c *MockChainClient) FetchHistoricalTradeRecords(ctx context.Context, marketId string) (*exchangetypes.QueryHistoricalTradeRecordsResponse, error) {
return &exchangetypes.QueryHistoricalTradeRecordsResponse{}, nil

Check warning on line 523 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L522-L523

Added lines #L522 - L523 were not covered by tests
}

func (c *MockChainClient) FetchIsOptedOutOfRewards(ctx context.Context, account string) (*exchangetypes.QueryIsOptedOutOfRewardsResponse, error) {
return &exchangetypes.QueryIsOptedOutOfRewardsResponse{}, nil

Check warning on line 527 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L526-L527

Added lines #L526 - L527 were not covered by tests
}

func (c *MockChainClient) FetchOptedOutOfRewardsAccounts(ctx context.Context) (*exchangetypes.QueryOptedOutOfRewardsAccountsResponse, error) {
return &exchangetypes.QueryOptedOutOfRewardsAccountsResponse{}, nil

Check warning on line 531 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L530-L531

Added lines #L530 - L531 were not covered by tests
}

func (c *MockChainClient) FetchMarketVolatility(ctx context.Context, marketId string, tradeHistoryOptions *exchangetypes.TradeHistoryOptions) (*exchangetypes.QueryMarketVolatilityResponse, error) {
return &exchangetypes.QueryMarketVolatilityResponse{}, nil

Check warning on line 535 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L534-L535

Added lines #L534 - L535 were not covered by tests
}

func (c *MockChainClient) FetchChainBinaryOptionsMarkets(ctx context.Context, status string) (*exchangetypes.QueryBinaryMarketsResponse, error) {
return &exchangetypes.QueryBinaryMarketsResponse{}, nil

Check warning on line 539 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L538-L539

Added lines #L538 - L539 were not covered by tests
}

func (c *MockChainClient) FetchTraderDerivativeConditionalOrders(ctx context.Context, subaccountId string, marketId string) (*exchangetypes.QueryTraderDerivativeConditionalOrdersResponse, error) {
return &exchangetypes.QueryTraderDerivativeConditionalOrdersResponse{}, nil

Check warning on line 543 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L542-L543

Added lines #L542 - L543 were not covered by tests
}

func (c *MockChainClient) FetchMarketAtomicExecutionFeeMultiplier(ctx context.Context, marketId string) (*exchangetypes.QueryMarketAtomicExecutionFeeMultiplierResponse, error) {
return &exchangetypes.QueryMarketAtomicExecutionFeeMultiplierResponse{}, nil

Check warning on line 547 in client/chain/chain_test_support.go

View check run for this annotation

Codecov / codecov/patch

client/chain/chain_test_support.go#L546-L547

Added lines #L546 - L547 were not covered by tests
}
Loading
Loading