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

bmresearch / Solnet / 13089373729

01 Feb 2025 02:08PM UTC coverage: 76.471% (-1.0%) from 77.499%
13089373729

Pull #478

github

web-flow
Merge 80979ad37 into 4c29360b0
Pull Request #478: Add Address lookup table Instruction

1113 of 1690 branches covered (65.86%)

Branch coverage included in aggregate %.

22 of 121 new or added lines in 10 files covered. (18.18%)

1 existing line in 1 file now uncovered.

5114 of 6453 relevant lines covered (79.25%)

1308873.54 hits per line

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

0.0
/src/Solnet.Programs/AddressLookupTableProgramData.cs
1
using System.Collections.Generic;
2
using Solnet.Programs.Utilities;
3
using Solnet.Wallet;
4

5
namespace Solnet.Programs
6
{
7
    internal static class AddressLookupTableProgramData
8
    {
9
        internal const int MethodOffset = 0;
10

11
        /// <summary>
12
        /// Encode transaction instruction data for the <see cref="AddressLookupTableProgramInstruction.Values.CreateLookupTable"/> method.
13
        /// </summary>
14
        /// <param name="Authority">Who own this table </param>
15
        /// <param name="Payer">Who pay for this table</param>
16
        /// <param name="RecentSlot">For random seed</param>
17
        /// <returns></returns>
18
        internal static byte[] EncodeCreateAddressLookupTableData( ulong RecentSlot,byte bump)
19
        {
NEW
20
            byte[] data = new byte[13];
×
NEW
21
            data.WriteU32((uint)AddressLookupTableProgramInstruction.Values.CreateLookupTable, MethodOffset);
×
NEW
22
            data.WriteU64(RecentSlot, 4);
×
NEW
23
            data.WriteU8(bump, 12);
×
24

NEW
25
            return data;
×
26
        }
27

28
        /// <summary>
29
        /// Encode transaction instruction data for the <see cref="AddressLookupTableProgramInstruction.Values.FreezeLookupTable"/> method.
30
        /// </summary>
31
        /// <returns></returns>
32
        internal static byte[] EncodeFreezeLookupTableData()
33
        {
NEW
34
            byte[] data = new byte[4];
×
NEW
35
            data.WriteU32((uint)AddressLookupTableProgramInstruction.Values.FreezeLookupTable, MethodOffset);
×
NEW
36
            return data;
×
37
        }
38

39
        /// <summary>
40
        /// Encode transaction instruction data for the <see cref="AddressLookupTableProgramInstruction.Values.ExtendLookupTable"/> method.
41
        /// </summary>
42
        /// <param name="RecentSlot"></param>
43
        /// <param name="Keys"></param>
44
        /// <returns></returns>
45
        internal static byte[] EncodeExtendLookupTableData(ulong KeyCounts,List<PublicKey> Keys)
46
        {
NEW
47
            byte[] data = new byte[12 + Keys.Count * 32];
×
NEW
48
            data.WriteU32((uint)AddressLookupTableProgramInstruction.Values.ExtendLookupTable, MethodOffset);
×
NEW
49
            data.WriteU64(KeyCounts, 4);
×
NEW
50
            for (int i = 0; i < Keys.Count; i++)
×
51
            {
NEW
52
                data.WritePubKey(Keys[i], 12 + i * 32);
×
53
            }
NEW
54
            return data;
×
55
        }
56

57
        /// <summary>
58
        /// Encode transaction instruction data for the <see cref="AddressLookupTableProgramInstruction.Values.DeactivateLookupTable"/> method.
59
        /// </summary>
60
        /// <returns></returns>
61
        internal static byte[] EncodeDeactivateLookupTableData()
62
        {
NEW
63
            byte[] data = new byte[4];
×
NEW
64
            data.WriteU32((uint)AddressLookupTableProgramInstruction.Values.DeactivateLookupTable, MethodOffset);
×
NEW
65
            return data;
×
66
        }
67

68
        /// <summary>
69
        /// Encode transaction instruction data for the <see cref="AddressLookupTableProgramInstruction.Values.CloseLookupTable"/> method.
70
        /// </summary>
71
        /// <returns></returns>
72
        internal static byte[] EncodeCloseLookupTableData()
73
        {
NEW
74
            byte[] data = new byte[4];
×
NEW
75
            data.WriteU32((uint)AddressLookupTableProgramInstruction.Values.CloseLookupTable, MethodOffset);
×
NEW
76
            return data;
×
77
        }
78
    }
79
}
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