fix: ๐Ÿ› chain balance type

This commit is contained in:
apotdevin 2021-01-24 18:25:22 +01:00
parent 34da8a3bc0
commit 603dcacd02
No known key found for this signature in database
GPG Key ID: 4403F1DFBE779457
11 changed files with 17 additions and 17 deletions

View File

@ -3,7 +3,7 @@
exports[`Chain Resolvers getChainBalance 1`] = `
Object {
"data": Object {
"getChainBalance": 1000000,
"getChainBalance": "1000000",
},
"errors": undefined,
"extensions": undefined,
@ -18,7 +18,7 @@ Object {
exports[`Chain Resolvers getPendingChainBalance 1`] = `
Object {
"data": Object {
"getPendingChainBalance": 1000000,
"getPendingChainBalance": "1000000",
},
"errors": undefined,
"extensions": undefined,

View File

@ -44,7 +44,7 @@ export const chainResolvers = {
lnd,
})
);
return value.chain_balance;
return value.chain_balance || 0;
},
getPendingChainBalance: async (
_: undefined,
@ -60,7 +60,7 @@ export const chainResolvers = {
lnd,
})
);
return pendingValue.pending_chain_balance;
return pendingValue.pending_chain_balance || 0;
},
getChainTransactions: async (
_: undefined,

View File

@ -79,8 +79,8 @@ export const queryTypes = gql`
getPeers: [peerType]
signMessage(message: String!): String
verifyMessage(message: String!, signature: String!): String
getChainBalance: Int
getPendingChainBalance: Int
getChainBalance: String!
getPendingChainBalance: String!
getChainTransactions: [getTransactionsType]
getUtxos: [getUtxosType]
getMessages(

View File

@ -7,7 +7,7 @@ export type BosPayMutationVariables = Types.Exact<{
max_fee: Types.Scalars['Int'];
max_paths: Types.Scalars['Int'];
message?: Types.Maybe<Types.Scalars['String']>;
out?: Types.Maybe<Array<Types.Maybe<Types.Scalars['String']>>>;
out?: Types.Maybe<Array<Types.Maybe<Types.Scalars['String']>> | Types.Maybe<Types.Scalars['String']>>;
request: Types.Scalars['String'];
}>;

View File

@ -4,7 +4,7 @@ import * as Types from '../../types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type BosRebalanceMutationVariables = Types.Exact<{
avoid?: Types.Maybe<Array<Types.Maybe<Types.Scalars['String']>>>;
avoid?: Types.Maybe<Array<Types.Maybe<Types.Scalars['String']>> | Types.Maybe<Types.Scalars['String']>>;
in_through?: Types.Maybe<Types.Scalars['String']>;
is_avoiding_high_inbound?: Types.Maybe<Types.Scalars['Boolean']>;
max_fee?: Types.Maybe<Types.Scalars['Int']>;

View File

@ -6,7 +6,7 @@ import * as Apollo from '@apollo/client';
export type CreateThunderPointsMutationVariables = Types.Exact<{
id: Types.Scalars['String'];
alias: Types.Scalars['String'];
uris: Array<Types.Scalars['String']>;
uris: Array<Types.Scalars['String']> | Types.Scalars['String'];
public_key: Types.Scalars['String'];
}>;

View File

@ -4,7 +4,7 @@ import * as Types from '../../types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type UpdateMultipleFeesMutationVariables = Types.Exact<{
channels: Array<Types.ChannelDetailInput>;
channels: Array<Types.ChannelDetailInput> | Types.ChannelDetailInput;
}>;

View File

@ -4,7 +4,7 @@ import * as Types from '../../types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type GetBoltzSwapStatusQueryVariables = Types.Exact<{
ids: Array<Types.Maybe<Types.Scalars['String']>>;
ids: Array<Types.Maybe<Types.Scalars['String']>> | Types.Maybe<Types.Scalars['String']>;
}>;

View File

@ -752,7 +752,7 @@ Object {
exports[`Query tests "GET_NODE_INFO" matches snapshot 1`] = `
Object {
"data": Object {
"getChainBalance": 1000000,
"getChainBalance": "1000000",
"getChannelBalance": Object {
"confirmedBalance": 1000000,
"pendingBalance": 50000,
@ -771,7 +771,7 @@ Object {
"pending_channels_count": 2,
"version": "version",
},
"getPendingChainBalance": 1000000,
"getPendingChainBalance": "1000000",
},
"errors": undefined,
"extensions": undefined,

View File

@ -83,8 +83,8 @@ export type Query = {
getPeers?: Maybe<Array<Maybe<PeerType>>>;
signMessage?: Maybe<Scalars['String']>;
verifyMessage?: Maybe<Scalars['String']>;
getChainBalance?: Maybe<Scalars['Int']>;
getPendingChainBalance?: Maybe<Scalars['Int']>;
getChainBalance: Scalars['String'];
getPendingChainBalance: Scalars['String'];
getChainTransactions?: Maybe<Array<Maybe<GetTransactionsType>>>;
getUtxos?: Maybe<Array<Maybe<GetUtxosType>>>;
getMessages?: Maybe<GetMessagesType>;

View File

@ -83,8 +83,8 @@ export const useNodeInfo = (): StatusState => {
mayorVersion: mayor,
minorVersion: minor,
revision: revision,
chainBalance: getChainBalance || 0,
chainPending: getPendingChainBalance || 0,
chainBalance: Number(getChainBalance) || 0,
chainPending: Number(getPendingChainBalance) || 0,
channelBalance: confirmedBalance,
channelPending: pendingBalance,
activeChannelCount: active_channels_count,