• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bmresearch / Solnet / 10672350157

02 Sep 2024 07:46PM UTC coverage: 77.453% (+0.2%) from 77.239%
10672350157

push

github

BifrostTitan
Agave v2.0 Migration

Updated the RPC client and removed deprecated code from the SDK.
Cleaned up all the warnings across the solution and added a few sys-vars that were missing.
Generate Seed in Mnemonic class now uses System.Security.Cryptography instead of bouncy castle sdk

1111 of 1682 branches covered (66.05%)

Branch coverage included in aggregate %.

6 of 10 new or added lines in 6 files covered. (60.0%)

18 existing lines in 4 files now uncovered.

5117 of 6359 relevant lines covered (80.47%)

1328281.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.0
/src/Solnet.Rpc/Models/Block.cs
1
// ReSharper disable UnusedAutoPropertyAccessor.Global
2
// ReSharper disable ClassNeverInstantiated.Global
3

4
using System.Text.Json.Serialization;
5

6
namespace Solnet.Rpc.Models
7
{
8
    /// <summary>
9
    /// Represents the block info.
10
    /// </summary>
11
    public class BlockInfo
12
    {
13
        /// <summary>
14
        /// Estimated block production time.
15
        /// </summary>
16
        public long BlockTime { get; set; }
2✔
17

18
        /// <summary>
19
        /// A base-58 encoded public key representing the block hash.
20
        /// </summary>
21
        public string Blockhash { get; set; }
2✔
22

23
        /// <summary>
24
        /// A base-58 encoded public key representing the block hash of this block's parent.
25
        /// <remarks>
26
        /// If the parent block is no longer available due to ledger cleanup, this field will return
27
        /// '11111111111111111111111111111111'
28
        /// </remarks>
29
        /// </summary>
30
        public string PreviousBlockhash { get; set; }
2✔
31

32
        /// <summary>
33
        /// The slot index of this block's parent.
34
        /// </summary>
35
        public ulong ParentSlot { get; set; }
2✔
36

37
        /// <summary>
38
        /// The number of blocks beneath this block.
39
        /// </summary>
40
        public long? BlockHeight { get; set; }
2✔
41

42
        /// <summary>
43
        /// Max transaction version allowed
44
        /// </summary>
UNCOV
45
        public int maxSupportedTransactionVersion { get; set; }
×
46

47
        /// <summary>
48
        /// The rewards for this given block.
49
        /// </summary>
50
        public RewardInfo[] Rewards { get; set; }
3✔
51

52
        /// <summary>
53
        /// Collection of transactions and their metadata within this block.
54
        /// </summary>
55
        public TransactionMetaInfo[] Transactions { get; set; }
3✔
56
    }
57

58
    /// <summary>
59
    /// Represents the transaction, metadata and its containing slot.
60
    /// </summary>
61
    public class TransactionMetaSlotInfo : TransactionMetaInfo
62
    {
63
        /// <summary>
64
        /// The slot this transaction was processed in.
65
        /// </summary>
66
        public ulong Slot { get; set; }
7✔
67

68
        /// <summary>
69
        /// Estimated block production time.
70
        /// </summary>
71
        public long? BlockTime { get; set; }
7✔
72
    }
73

74

75
    /// <summary>
76
    /// Represents the tuple transaction and metadata.
77
    /// </summary>
78
    public class TransactionMetaInfo
79
    {
80
        /// <summary>
81
        /// The transaction information.
82
        /// </summary>
83
        public TransactionInfo Transaction { get; set; }
128✔
84

85
        /// <summary>
86
        /// The metadata information.
87
        /// </summary>
88
        public TransactionMeta Meta { get; set; }
57✔
89
    }
90

91
    /// <summary>
92
    /// Represents the reward information related to a given account.
93
    /// </summary>
94
    public class RewardInfo
95
    {
96
        /// <summary>
97
        /// The account pubkey as base58 encoded string.
98
        /// </summary>
99
        public string Pubkey { get; set; }
2✔
100
        /// <summary>
101
        /// Number of reward lamports credited or debited by the account.
102
        /// </summary>
103
        public long Lamports { get; set; }
2✔
104

105
        /// <summary>
106
        /// Account balance in lamports after the reward was applied.
107
        /// </summary>
108
        public ulong PostBalance { get; set; }
2✔
109

110
        /// <summary>
111
        /// Type of the reward.
112
        /// </summary>
113
        public RewardType RewardType { get; set; }
2✔
114
    }
115

116
    /// <summary>
117
    /// The type of the reward.
118
    /// </summary>
119
    public enum RewardType
120
    {
121
        /// <summary>
122
        /// Default value in case the returned value is undefined.
123
        /// </summary>
124
        Unknown,
125

126
        /// <summary>
127
        /// Fee reward.
128
        /// </summary>
129
        Fee,
130

131
        /// <summary>
132
        /// Rent reward.
133
        /// </summary>
134
        Rent,
135

136
        /// <summary>
137
        /// Voting reward.
138
        /// </summary>
139
        Voting,
140

141
        /// <summary>
142
        /// Staking reward.
143
        /// </summary>
144
        Staking
145
    }
146

147
    /// <summary>
148
    /// Represents a transaction.
149
    /// </summary>
150
    public class TransactionInfo
151
    {
152
        /// <summary>
153
        /// The signatures of this transaction.
154
        /// </summary>
155
        public string[] Signatures { get; set; }
13✔
156

157
        /// <summary>
158
        /// The message contents of the transaction.
159
        /// </summary>
160
        public TransactionContentInfo Message { get; set; }
124✔
161
    }
162

163
    /// <summary>
164
    /// Represents the contents of the trasaction.
165
    /// </summary>
166
    public class TransactionContentInfo
167
    {
168
        /// <summary>
169
        /// List of base-58 encoded public keys used by the transaction, including by the instructions and for signatures.
170
        /// </summary>
171
        public string[] AccountKeys { get; set; }
75✔
172

173
        /// <summary>
174
        /// Details the account types and signatures required by the transaction.
175
        /// </summary>
176
        public TransactionHeaderInfo Header { get; set; }
15✔
177

178
        /// <summary>
179
        ///  A base-58 encoded hash of a recent block in the ledger used to prevent transaction duplication and to give transactions lifetimes.
180
        /// </summary>
181
        public string RecentBlockhash { get; set; }
11✔
182

183
        /// <summary>
184
        /// List of program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
185
        /// </summary>
186
        public InstructionInfo[] Instructions { get; set; }
50✔
187
    }
188

189
    /// <summary>
190
    /// Details the number and type of accounts and signatures in a given transaction.
191
    /// </summary>
192
    public class TransactionHeaderInfo
193
    {
194
        /// <summary>
195
        /// The total number of signatures required to make the transaction valid. 
196
        /// </summary>
197
        public int NumRequiredSignatures { get; set; }
11✔
198

199
        /// <summary>
200
        /// The last NumReadonlySignedAccounts of the signed keys are read-only accounts.
201
        /// </summary>
202
        public int NumReadonlySignedAccounts { get; set; }
11✔
203

204
        /// <summary>
205
        /// The last NumReadonlyUnsignedAccounts of the unsigned keys are read-only accounts.
206
        /// </summary>
207
        public int NumReadonlyUnsignedAccounts { get; set; }
11✔
208
    }
209

210
    /// <summary>
211
    /// Represents the transaction metadata.
212
    /// </summary>
213
    public class TransactionMeta
214
    {
215
        /// <summary>
216
        /// Possible transaction error.
217
        /// </summary>
218
        [JsonPropertyName("err")]
219
        public TransactionError Error { get; set; }
17✔
220

221
        /// <summary>
222
        /// Fee this transaction was charged.
223
        /// </summary>
224
        public ulong Fee { get; set; }
11✔
225

226
        /// <summary>
227
        /// Collection of account balances from before the transaction was processed.
228
        /// </summary>
229
        public ulong[] PreBalances { get; set; }
13✔
230

231
        /// <summary>
232
        /// Collection of account balances after the transaction was processed.
233
        /// </summary>
234
        public ulong[] PostBalances { get; set; }
13✔
235

236
        /// <summary>
237
        /// List of inner instructions or omitted if inner instruction recording was not yet enabled during this transaction.
238
        /// </summary>
239
        public InnerInstruction[] InnerInstructions { get; set; }
33✔
240

241
        /// <summary>
242
        /// List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction.
243
        /// </summary>
244
        public TokenBalanceInfo[] PreTokenBalances { get; set; }
11✔
245

246
        /// <summary>
247
        /// List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction.
248
        /// </summary>
249
        public TokenBalanceInfo[] PostTokenBalances { get; set; }
11✔
250

251
        /// <summary>
252
        /// Array of string log messages or omitted if log message recording was not yet enabled during this transaction.
253
        /// </summary>
254
        public string[] LogMessages { get; set; }
11✔
255
    }
256

257
    /// <summary>
258
    /// Represents the structure of a token balance metadata for a transaction.
259
    /// </summary>
260
    public class TokenBalanceInfo
261
    {
262
        /// <summary>
263
        /// Index of the account in which the token balance is provided for.
264
        /// </summary>
265
        public int AccountIndex { get; set; }
29✔
266

267
        /// <summary>
268
        /// Pubkey of the token's mint.
269
        /// </summary>
270
        public string Mint { get; set; }
29✔
271

272
        /// <summary>
273
        /// Pubkey of the token owner
274
        /// </summary>
275
        public string Owner { get; set; }
2✔
276

277
        /// <summary>
278
        /// Token balance details.
279
        /// </summary>
280
        public TokenBalance UiTokenAmount { get; set; }
29✔
281
    }
282

283
    /// <summary>
284
    /// Represents an inner instruction. Inner instruction are cross-program instructions that are invoked during transaction processing.
285
    /// </summary>
286
    public class InnerInstruction
287
    {
288
        /// <summary>
289
        /// Index of the transaction instruction from which the inner instruction(s) originated
290
        /// </summary>
291
        public int Index { get; set; }
20✔
292

293
        /// <summary>
294
        /// List of program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
295
        /// </summary>
296
        public InstructionInfo[] Instructions { get; set; }
12✔
297
    }
298

299
    /// <summary>
300
    /// Represents the data of given instruction.
301
    /// </summary>
302
    public class InstructionInfo
303
    {
304
        /// <summary>
305
        /// Index into the <i>Message.AccountKeys</i> array indicating the program account that executes this instruction.
306
        /// </summary>
307
        public int ProgramIdIndex { get; set; }
73✔
308

309
        /// <summary>
310
        /// List of ordered indices into the <i>Message.AccountKeys</i> array indicating which accounts to pass to the program.
311
        /// </summary>
312
        public int[] Accounts { get; set; }
73✔
313

314
        /// <summary>
315
        /// The program input data encoded in a base-58 string.
316
        /// </summary>
317
        public string Data { get; set; }
73✔
318
    }
319

320
    /// <summary>
321
    /// Represents the block commitment info.
322
    /// </summary>
323
    public class BlockCommitment
324
    {
325
        /// <summary>
326
        /// A list of values representing the amount of cluster stake in lamports that has
327
        /// voted onn the block at each depth from 0 to (max lockout history + 1).
328
        /// </summary>
329
        public ulong[] Commitment { get; set; }
2✔
330

331
        /// <summary>
332
        /// Total active stake, in lamports, of the current epoch.
333
        /// </summary>
334
        public ulong TotalStake { get; set; }
2✔
335
    }
336

337
    /// <summary>
338
    /// Represents the fee calculator info.
339
    /// </summary>
340
    public class FeeCalculator
341
    {
342
        /// <summary>
343
        /// The amount, in lamports, to be paid per signature.
344
        /// </summary>
345
        public ulong LamportsPerSignature { get; set; }
2✔
346
    }
347

348
    /// <summary>
349
    /// Represents the fee calculator info.
350
    /// </summary>
351
    public class FeeCalculatorInfo
352
    {
353
        /// <summary>
354
        /// The fee calculator info.
355
        /// </summary>
UNCOV
356
        public FeeCalculator FeeCalculator { get; set; }
×
357
    }
358

359
    /// <summary>
360
    /// Represents block hash info.
361
    /// </summary>
362
    public class BlockHash
363
    {
364
        /// <summary>
365
        /// A base-58 encoded string representing the block hash.
366
        /// </summary>
UNCOV
367
        public string Blockhash { get; set; }
×
368

369
        /// <summary>
370
        /// The fee calculator data.
371
        /// </summary>
UNCOV
372
        public FeeCalculator FeeCalculator { get; set; }
×
373
    }
374

375
    /// <summary>
376
    /// Represents the latest block hash info.
377
    /// </summary>
378
    public class LatestBlockHash
379
    {
380
        /// <summary>
381
        /// A base-58 encoded string representing the block hash.
382
        /// </summary>
383
        public string Blockhash { get; set; }
4✔
384

385
        /// <summary>
386
        /// The last block height at which the blockhash will be valid.
387
        /// </summary>
388
        public ulong LastValidBlockHeight { get; set; }
2✔
389
    }
390
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc