Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to package information
Browse files Browse the repository at this point in the history
EasterTheBunny committed Mar 8, 2024

Verified

This commit was signed with the committer’s verified signature.
EasterTheBunny Awbrey Hughlett
1 parent 8bbbbf4 commit f942bf0
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/solana/chain_reader_test.go
Original file line number Diff line number Diff line change
@@ -305,7 +305,7 @@ func (r *chainReaderInterfaceTester) Name() string {

func (r *chainReaderInterfaceTester) Setup(t *testing.T) {
r.address = make([]string, 6)
for idx, _ := range r.address {
for idx := range r.address {
r.address[idx] = ag_solana.NewWallet().PublicKey().String()
}

24 changes: 17 additions & 7 deletions pkg/solana/codec/solana.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
/*
Package codec provides functions to create a codec from an Anchor IDL using NewIDLCodec. All primitives map 1:1, however
some common types are either not supported or may not have expected behavior.
Using time.Time as a native struct for encoding or decoding to and IDL unixTimestamp primitive will not work without
the codec modifier `ModifierEpochToTime`. The native value to represent timestamps is int64.
Enums are only supported in their basic form of uint8 values. Enums with variants are not supported.
Package codec provides functions to create a codec from an Anchor IDL. All Anchor primitives map to the following native
Go values:
bool -> bool
string -> string
bytes -> []byte
[u|i][8-64] -> [u]int[8-64]
[u|i]128 -> *big.Int
duration -> time.Duration
unixTimestamp -> int64
publicKey -> [32]byte
hash -> [32]byte
Enums as an Anchor data structure are only supported in their basic form of uint8 values. Enums with variants are not
supported at this time.
Modifiers can be provided to assist in modifying property names, adding properties, etc.
*/
package codec

0 comments on commit f942bf0

Please sign in to comment.