Skip to content

Commit bec22fb

Browse files
RANE-4333 emit plugin relayer config (#1445)
* RANE-4333 emit plugin relayer config * Update chainlink-common and chainlink-protos dependencies in go.mod and go.sum * Restore codec v1 API compatibility and harden ALT setup test * Add compatibility for new IDL type constants and default hash bit length * chore: trigger CI
1 parent f96bb43 commit bec22fb

File tree

9 files changed

+299
-13
lines changed

9 files changed

+299
-13
lines changed

contracts/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ require (
109109
github.com/sirupsen/logrus v1.9.3 // indirect
110110
github.com/smartcontractkit/chain-selectors v1.0.90 // indirect
111111
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 // indirect
112-
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935 // indirect
112+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260209213544-a82fa419e483 // indirect
113113
github.com/smartcontractkit/chainlink-testing-framework/framework v0.13.0 // indirect
114114
github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20251014143056-a0c6328c91e9 // indirect
115115
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e // indirect

contracts/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8
452452
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw=
453453
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA=
454454
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg=
455-
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935 h1:Uj+LW45bBgdaDRF8C7hUtM8LOh7rZ5qZJxZhsTTusvY=
456-
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935/go.mod h1:zBuRC7el/pQQB95t7JnLOvCfZ3lmi5jjXYRUY2XUD+g=
455+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260209213544-a82fa419e483 h1:hvGO6UNdkC5eMK35AnC1VrTgml/WLoJuq75AIpPaG2A=
456+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260209213544-a82fa419e483/go.mod h1:SuYKqFFxcBcph/0rxs8cbJWvpGNAQJ1lvm8npVcMtyw=
457457
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg=
458458
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY=
459459
github.com/smartcontractkit/chainlink-deployments-framework v0.75.0 h1:9ZjyePOYM5+M/d5JHOA5dUx6UdDWqqS0NRlvFRlHUII=

contracts/gotests/keystone_forwarder_test.go

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package keystone_forwarder_test
22

33
import (
44
"bytes"
5+
"context"
56
"crypto/ecdsa"
67
"crypto/sha256"
78
"encoding/binary"
@@ -448,11 +449,11 @@ func TestKeystoneForwarder(t *testing.T) {
448449
// because this fails to find the correct slot sometimes.
449450
var lookupTableAddress solana.PublicKey
450451
for attempt := 0; attempt < 3; attempt++ {
451-
lookupTableAddress, err = common.SetupLookupTable(t.Context(), solanaClient, deployerKey, lookupAccounts)
452+
lookupTableAddress, err = setupLookupTableWithSafeSlot(t.Context(), solanaClient, deployerKey, lookupAccounts)
452453
if err == nil {
453454
break
454455
}
455-
if attempt < 5 {
456+
if attempt < 2 {
456457
t.Logf("SetupLookupTable attempt %d failed: %v, retrying...", attempt+1, err)
457458
time.Sleep(500 * time.Millisecond)
458459
}
@@ -870,3 +871,43 @@ func getOraclesConfigAddress(t *testing.T, state solana.PublicKey, donId uint32,
870871
)
871872
return oraclesConfigAddress
872873
}
874+
875+
func setupLookupTableWithSafeSlot(ctx context.Context, client *rpc.Client, admin solana.PrivateKey, entries []solana.PublicKey) (solana.PublicKey, error) {
876+
slot, err := client.GetSlot(ctx, rpc.CommitmentConfirmed)
877+
if err != nil {
878+
return solana.PublicKey{}, err
879+
}
880+
881+
// common.SetupLookupTable uses (slot - 1). When slot is 0 this underflows to MaxUint64 and fails.
882+
createSlot := slot
883+
if slot > 1 {
884+
createSlot = slot - 1
885+
}
886+
887+
table, createIx, err := common.NewCreateLookupTableInstruction(admin.PublicKey(), admin.PublicKey(), createSlot)
888+
if err != nil {
889+
return solana.PublicKey{}, err
890+
}
891+
892+
_, err = common.SendAndConfirmWithLookupTablesAndRetries(
893+
ctx,
894+
client,
895+
[]solana.Instruction{createIx},
896+
admin,
897+
rpc.CommitmentConfirmed,
898+
map[solana.PublicKey]solana.PublicKeySlice{},
899+
)
900+
if err != nil {
901+
return solana.PublicKey{}, err
902+
}
903+
904+
if err = common.ExtendLookupTable(ctx, client, table, admin, entries); err != nil {
905+
return solana.PublicKey{}, err
906+
}
907+
908+
if err = common.AwaitSlotChange(ctx, client); err != nil {
909+
return solana.PublicKey{}, err
910+
}
911+
912+
return table, nil
913+
}

go.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ flowchart LR
1414
click chainlink-ccip/chains/solana href "https://github.com/smartcontractkit/chainlink-ccip"
1515
chainlink-ccip/chains/solana/gobindings
1616
click chainlink-ccip/chains/solana/gobindings href "https://github.com/smartcontractkit/chainlink-ccip"
17-
chainlink-common --> chain-selectors
1817
chainlink-common --> chainlink-common/pkg/chipingress
1918
chainlink-common --> chainlink-protos/billing/go
2019
chainlink-common --> chainlink-protos/cre/go
2120
chainlink-common --> chainlink-protos/linking-service/go
21+
chainlink-common --> chainlink-protos/node-platform
2222
chainlink-common --> chainlink-protos/storage-service
2323
chainlink-common --> chainlink-protos/workflows/go
2424
chainlink-common --> freeport
@@ -42,10 +42,12 @@ flowchart LR
4242
click chainlink-framework/multinode href "https://github.com/smartcontractkit/chainlink-framework"
4343
chainlink-protos/billing/go
4444
click chainlink-protos/billing/go href "https://github.com/smartcontractkit/chainlink-protos"
45-
chainlink-protos/cre/go
45+
chainlink-protos/cre/go --> chain-selectors
4646
click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos"
4747
chainlink-protos/linking-service/go
4848
click chainlink-protos/linking-service/go href "https://github.com/smartcontractkit/chainlink-protos"
49+
chainlink-protos/node-platform
50+
click chainlink-protos/node-platform href "https://github.com/smartcontractkit/chainlink-protos"
4951
chainlink-protos/rmn/v1.6/go
5052
click chainlink-protos/rmn/v1.6/go href "https://github.com/smartcontractkit/chainlink-protos"
5153
chainlink-protos/storage-service
@@ -92,6 +94,7 @@ flowchart LR
9294
chainlink-protos/billing/go
9395
chainlink-protos/cre/go
9496
chainlink-protos/linking-service/go
97+
chainlink-protos/node-platform
9598
chainlink-protos/rmn/v1.6/go
9699
chainlink-protos/storage-service
97100
chainlink-protos/workflows/go

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ require (
2222
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260127052127-9e53e86176d3
2323
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d
2424
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5
25-
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935
25+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260209213544-a82fa419e483
2626
github.com/smartcontractkit/chainlink-common/keystore v1.0.0
2727
github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340
2828
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15
2929
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942
30-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9
30+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260209203401-a488315d180f
3131
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e
3232
github.com/smartcontractkit/libocr v0.0.0-20251212213002-0a5e2f907dda
3333
github.com/stretchr/testify v1.11.1
@@ -154,6 +154,7 @@ require (
154154
github.com/shopspring/decimal v1.4.0 // indirect
155155
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect
156156
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect
157+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect
157158
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
158159
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect
159160
github.com/stretchr/objx v0.5.2 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8
566566
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw=
567567
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA=
568568
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg=
569-
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935 h1:Uj+LW45bBgdaDRF8C7hUtM8LOh7rZ5qZJxZhsTTusvY=
570-
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935/go.mod h1:zBuRC7el/pQQB95t7JnLOvCfZ3lmi5jjXYRUY2XUD+g=
569+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260209213544-a82fa419e483 h1:hvGO6UNdkC5eMK35AnC1VrTgml/WLoJuq75AIpPaG2A=
570+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260209213544-a82fa419e483/go.mod h1:SuYKqFFxcBcph/0rxs8cbJWvpGNAQJ1lvm8npVcMtyw=
571571
github.com/smartcontractkit/chainlink-common/keystore v1.0.0 h1:sVa3j2FWK/5OxXpnlfDkF1deDAkuXEfaLKzYqBTA880=
572572
github.com/smartcontractkit/chainlink-common/keystore v1.0.0/go.mod h1:wGRJJlCFUOKIfBlBGEdBFiTf7R787B8HKyobjiymw3Q=
573573
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg=
@@ -578,10 +578,12 @@ github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c
578578
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15/go.mod h1:HG/aei0MgBOpsyRLexdKGtOUO8yjSJO3iUu0Uu8KBm4=
579579
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 h1:T/eCDsUI8EJT4n5zSP4w1mz4RHH+ap8qieA17QYfBhk=
580580
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942/go.mod h1:2JTBNp3FlRdO/nHc4dsc9bfxxMClMO1Qt8sLJgtreBY=
581-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M=
582-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
581+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260209203401-a488315d180f h1:YBpKK0O7IcbkMyhPRXxA4HGh9OYt+N5Qicx28z8NMvE=
582+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260209203401-a488315d180f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
583583
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM=
584584
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY=
585+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8=
586+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM=
585587
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e h1:Hv9Mww35LrufCdM9wtS9yVi/rEWGI1UnjHbcKKU0nVY=
586588
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e/go.mod h1:T4zH9R8R8lVWKfU7tUvYz2o2jMv1OpGCdpY2j2QZXzU=
587589
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=

pkg/solana/cmd/chainlink-solana/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/hashicorp/go-plugin"
99
"github.com/pelletier/go-toml/v2"
1010

11+
"github.com/smartcontractkit/chainlink-common/pkg/beholder"
1112
"github.com/smartcontractkit/chainlink-common/pkg/loop"
1213
"github.com/smartcontractkit/chainlink-common/pkg/sqlutil"
1314
"github.com/smartcontractkit/chainlink-common/pkg/types/core"
@@ -64,6 +65,28 @@ func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore
6465
return nil, fmt.Errorf("failed to decode config toml: %w:\n\t%s", err, config)
6566
}
6667

68+
rawNodes := make([]map[string]string, 0, len(cfg.Solana.Nodes))
69+
for _, n := range cfg.Solana.Nodes {
70+
if n == nil || n.URL == nil {
71+
continue
72+
}
73+
rawNodes = append(rawNodes, map[string]string{"URL": n.URL.String()})
74+
}
75+
chainID := ""
76+
if cfg.Solana.ChainID != nil {
77+
chainID = *cfg.Solana.ChainID
78+
}
79+
emitter := loop.NewPluginRelayerConfigEmitter(
80+
c.Logger,
81+
beholder.GetClient().Config.AuthPublicKeyHex,
82+
chainID,
83+
rawNodes,
84+
)
85+
if err := emitter.Start(ctx); err != nil {
86+
return nil, fmt.Errorf("failed to start plugin relayer config emitter: %w", err)
87+
}
88+
c.SubService(emitter)
89+
6790
opts := solana.ChainOpts{
6891
Logger: c.Logger,
6992
KeyStore: keystore,

pkg/solana/codec/compat_v1.go

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
package codec
2+
3+
import (
4+
commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec"
5+
"github.com/smartcontractkit/chainlink-common/pkg/codec/encodings"
6+
commontypes "github.com/smartcontractkit/chainlink-common/pkg/types"
7+
8+
solcommoncodec "github.com/smartcontractkit/chainlink-solana/pkg/solana/codec/common"
9+
codecv1 "github.com/smartcontractkit/chainlink-solana/pkg/solana/codec/v1"
10+
)
11+
12+
// Backward-compatible aliases for the old pkg/solana/codec public API.
13+
// The underlying implementation now lives in pkg/solana/codec/v1 and pkg/solana/codec/common.
14+
15+
type ChainConfigType = solcommoncodec.ChainConfigType
16+
17+
const (
18+
ChainConfigTypeAccountDef = solcommoncodec.ChainConfigTypeAccountDef
19+
ChainConfigTypeInstructionDef = solcommoncodec.ChainConfigTypeInstructionDef
20+
ChainConfigTypeEventDef = solcommoncodec.ChainConfigTypeEventDef
21+
)
22+
23+
type Config = solcommoncodec.Config
24+
type ChainConfig = solcommoncodec.ChainConfig
25+
type Entry = solcommoncodec.Entry
26+
type ParsedTypes = solcommoncodec.ParsedTypes
27+
28+
var DecoderHooks = solcommoncodec.DecoderHooks
29+
30+
func WrapItemType(forEncoding bool, contractName, itemType string) string {
31+
return solcommoncodec.WrapItemType(forEncoding, contractName, itemType)
32+
}
33+
34+
func AddEntries(defs map[string]Entry, modByTypeName map[string]map[string]commoncodec.Modifier) error {
35+
return solcommoncodec.AddEntries(defs, modByTypeName)
36+
}
37+
38+
func EntryAsModifierRemoteCodec(entry Entry, itemType string) (commontypes.RemoteCodec, error) {
39+
return solcommoncodec.EntryAsModifierRemoteCodec(entry, itemType)
40+
}
41+
42+
type IDL = codecv1.IDL
43+
type IdlConstant = codecv1.IdlConstant
44+
type IdlTypeDefSlice = codecv1.IdlTypeDefSlice
45+
type IdlEvent = codecv1.IdlEvent
46+
type IdlEventField = codecv1.IdlEventField
47+
type IdlInstruction = codecv1.IdlInstruction
48+
type IdlAccountItemSlice = codecv1.IdlAccountItemSlice
49+
type IdlAccountItem = codecv1.IdlAccountItem
50+
type IdlAccount = codecv1.IdlAccount
51+
type IdlAccounts = codecv1.IdlAccounts
52+
type IdlField = codecv1.IdlField
53+
type PDATypeDef = codecv1.PDATypeDef
54+
type PDASeed = codecv1.PDASeed
55+
type IdlTypeAsString = codecv1.IdlTypeAsString
56+
type IdlTypeVec = codecv1.IdlTypeVec
57+
type IdlTypeOption = codecv1.IdlTypeOption
58+
type IdlTypeDefined = codecv1.IdlTypeDefined
59+
type IdlTypeArray = codecv1.IdlTypeArray
60+
type IdlType = codecv1.IdlType
61+
type IdlTypeDef = codecv1.IdlTypeDef
62+
type IdlTypeDefTyKind = codecv1.IdlTypeDefTyKind
63+
type IdlTypeDefTyStruct = codecv1.IdlTypeDefTyStruct
64+
type IdlTypeDefTyEnum = codecv1.IdlTypeDefTyEnum
65+
type IdlTypeDefTy = codecv1.IdlTypeDefTy
66+
type IdlEnumVariantSlice = codecv1.IdlEnumVariantSlice
67+
type IdlTypeDefStruct = codecv1.IdlTypeDefStruct
68+
type IdlEnumVariant = codecv1.IdlEnumVariant
69+
type IdlEnumFields = codecv1.IdlEnumFields
70+
type IdlEnumFieldsNamed = codecv1.IdlEnumFieldsNamed
71+
type IdlEnumFieldsTuple = codecv1.IdlEnumFieldsTuple
72+
type IdlErrorCode = codecv1.IdlErrorCode
73+
74+
const (
75+
IdlTypeDefTyKindStruct = codecv1.IdlTypeDefTyKindStruct
76+
IdlTypeDefTyKindEnum = codecv1.IdlTypeDefTyKindEnum
77+
IdlTypeDefTyKindCustom = codecv1.IdlTypeDefTyKindCustom
78+
)
79+
80+
const (
81+
IdlTypeBool = codecv1.IdlTypeBool
82+
IdlTypeU8 = codecv1.IdlTypeU8
83+
IdlTypeI8 = codecv1.IdlTypeI8
84+
IdlTypeU16 = codecv1.IdlTypeU16
85+
IdlTypeI16 = codecv1.IdlTypeI16
86+
IdlTypeU32 = codecv1.IdlTypeU32
87+
IdlTypeI32 = codecv1.IdlTypeI32
88+
IdlTypeU64 = codecv1.IdlTypeU64
89+
IdlTypeI64 = codecv1.IdlTypeI64
90+
IdlTypeU128 = codecv1.IdlTypeU128
91+
IdlTypeI128 = codecv1.IdlTypeI128
92+
IdlTypeBytes = codecv1.IdlTypeBytes
93+
IdlTypeString = codecv1.IdlTypeString
94+
IdlTypePublicKey = codecv1.IdlTypePublicKey
95+
IdlTypeUnixTimestamp = codecv1.IdlTypeUnixTimestamp
96+
IdlTypeHash = codecv1.IdlTypeHash
97+
IdlTypeDuration = codecv1.IdlTypeDuration
98+
)
99+
100+
const DefaultHashBitLength = codecv1.DefaultHashBitLength
101+
102+
var NilIdlTypeDefTy = codecv1.NilIdlTypeDefTy
103+
104+
func NewIdlStringType(asString IdlTypeAsString) IdlType {
105+
return codecv1.NewIdlStringType(asString)
106+
}
107+
108+
type AccountIDLTypes = codecv1.AccountIDLTypes
109+
type InstructionArgsIDLTypes = codecv1.InstructionArgsIDLTypes
110+
type EventIDLTypes = codecv1.EventIDLTypes
111+
112+
func NewAccountEntry(offchainName string, idlTypes AccountIDLTypes, includeDiscriminator bool, mod commoncodec.Modifier, builder encodings.Builder) (Entry, error) {
113+
return codecv1.NewAccountEntry(offchainName, idlTypes, includeDiscriminator, mod, builder)
114+
}
115+
116+
func NewPDAEntry(offchainName string, pdaTypeDef PDATypeDef, mod commoncodec.Modifier, builder encodings.Builder) (Entry, error) {
117+
return codecv1.NewPDAEntry(offchainName, pdaTypeDef, mod, builder)
118+
}
119+
120+
func NewInstructionArgsEntry(offChainName string, idlTypes InstructionArgsIDLTypes, mod commoncodec.Modifier, builder encodings.Builder) (Entry, error) {
121+
return codecv1.NewInstructionArgsEntry(offChainName, idlTypes, mod, builder)
122+
}
123+
124+
func NewEventArgsEntryWrapper(offChainName string, contractIdl string, includeDiscriminator bool, mod commoncodec.Modifier, builder encodings.Builder) (Entry, error) {
125+
return codecv1.NewEventArgsEntryWrapper(offChainName, contractIdl, includeDiscriminator, mod, builder)
126+
}
127+
128+
func NewEventArgsEntry(offChainName string, idlTypes EventIDLTypes, includeDiscriminator bool, mod commoncodec.Modifier, builder encodings.Builder) (Entry, error) {
129+
return codecv1.NewEventArgsEntry(offChainName, idlTypes, includeDiscriminator, mod, builder)
130+
}
131+
132+
func NewOnRampAddress(builder encodings.Builder) encodings.TypeCodec {
133+
return codecv1.NewOnRampAddress(builder)
134+
}
135+
136+
func NewCodec(conf Config) (commontypes.RemoteCodec, error) {
137+
return codecv1.NewCodec(conf)
138+
}
139+
140+
func CreateCodecEntry(idlDefinition interface{}, offChainName string, idl IDL, mod commoncodec.Modifier) (entry Entry, err error) {
141+
return codecv1.CreateCodecEntry(idlDefinition, offChainName, idl, mod)
142+
}
143+
144+
func CreateCodecEntryWrapper(cfgType ChainConfigType, mod commoncodec.Modifier, onChainName, offChainName, idlString string) (entry Entry, err error) {
145+
return codecv1.CreateCodecEntryWrapper(cfgType, mod, onChainName, offChainName, idlString)
146+
}
147+
148+
func FindDefinitionFromIDL(cfgType ChainConfigType, chainSpecificName string, idl IDL) (interface{}, error) {
149+
return codecv1.FindDefinitionFromIDL(cfgType, chainSpecificName, idl)
150+
}
151+
152+
func ExtractEventIDL(eventName string, idl IDL) (IdlEvent, error) {
153+
return codecv1.ExtractEventIDL(eventName, idl)
154+
}
155+
156+
func NewIDLAccountCodec(idl IDL, builder encodings.Builder) (commontypes.RemoteCodec, error) {
157+
return codecv1.NewIDLAccountCodec(idl, builder)
158+
}
159+
160+
func NewNamedModifierCodec(original commontypes.RemoteCodec, itemType string, modifier commoncodec.Modifier) (commontypes.RemoteCodec, error) {
161+
return codecv1.NewNamedModifierCodec(original, itemType, modifier)
162+
}
163+
164+
func NewIDLDefinedTypesCodec(idl IDL, builder encodings.Builder) (commontypes.RemoteCodec, error) {
165+
return codecv1.NewIDLDefinedTypesCodec(idl, builder)
166+
}

0 commit comments

Comments
 (0)