diff --git a/common/program_id.go b/common/program_id.go index 6ac74fdc..d20de601 100644 --- a/common/program_id.go +++ b/common/program_id.go @@ -16,4 +16,5 @@ var ( AddressLookupTableProgramID = PublicKeyFromString("AddressLookupTab1e1111111111111111111111111") Token2022ProgramID = PublicKeyFromString("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb") BPFLoaderUpgradeableProgramID = PublicKeyFromString("BPFLoaderUpgradeab1e11111111111111111111111") + NativeMint = PublicKeyFromString("So11111111111111111111111111111111111111112") ) diff --git a/program/token/state_test.go b/program/token/state_test.go index 7848f0e2..e3ca67c3 100644 --- a/program/token/state_test.go +++ b/program/token/state_test.go @@ -39,7 +39,7 @@ func TestAccountFromData(t *testing.T) { data: []byte{0x6, 0x9b, 0x88, 0x57, 0xfe, 0xab, 0x81, 0x84, 0xfb, 0x68, 0x7f, 0x63, 0x46, 0x18, 0xc0, 0x35, 0xda, 0xc4, 0x39, 0xdc, 0x1a, 0xeb, 0x3b, 0x55, 0x98, 0xa0, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x10, 0x96, 0x59, 0x17, 0x5e, 0x7c, 0x64, 0x33, 0x21, 0xa5, 0xed, 0x46, 0x42, 0xa0, 0x27, 0xb0, 0xab, 0xd9, 0x7b, 0x8d, 0xd9, 0x7a, 0xd1, 0xbc, 0xc6, 0xdc, 0x64, 0x71, 0x38, 0x6c, 0xcd, 0xdc, 0x10, 0x76, 0x16, 0x77, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0, 0xf0, 0x1d, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, }, want: TokenAccount{ - Mint: common.PublicKeyFromString("So11111111111111111111111111111111111111112"), + Mint: common.NativeMint, Owner: common.PublicKeyFromString("27kVX7JpPZ1bsrSckbR76mV6GeRqtrjoddubfg2zBpHZ"), Amount: 1997960720, Delegate: nil, @@ -245,7 +245,7 @@ func TestDeserializeTokenAccount(t *testing.T) { accountOwner: common.TokenProgramID, }, want: TokenAccount{ - Mint: common.PublicKeyFromString("So11111111111111111111111111111111111111112"), + Mint: common.NativeMint, Owner: common.PublicKeyFromString("27kVX7JpPZ1bsrSckbR76mV6GeRqtrjoddubfg2zBpHZ"), Amount: 1997960720, Delegate: nil, diff --git a/program/tokenprog/state_test.go b/program/tokenprog/state_test.go index d532d7b6..7e322059 100644 --- a/program/tokenprog/state_test.go +++ b/program/tokenprog/state_test.go @@ -39,7 +39,7 @@ func TestAccountFromData(t *testing.T) { data: []byte{0x6, 0x9b, 0x88, 0x57, 0xfe, 0xab, 0x81, 0x84, 0xfb, 0x68, 0x7f, 0x63, 0x46, 0x18, 0xc0, 0x35, 0xda, 0xc4, 0x39, 0xdc, 0x1a, 0xeb, 0x3b, 0x55, 0x98, 0xa0, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x10, 0x96, 0x59, 0x17, 0x5e, 0x7c, 0x64, 0x33, 0x21, 0xa5, 0xed, 0x46, 0x42, 0xa0, 0x27, 0xb0, 0xab, 0xd9, 0x7b, 0x8d, 0xd9, 0x7a, 0xd1, 0xbc, 0xc6, 0xdc, 0x64, 0x71, 0x38, 0x6c, 0xcd, 0xdc, 0x10, 0x76, 0x16, 0x77, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0, 0xf0, 0x1d, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, }, want: TokenAccount{ - Mint: common.PublicKeyFromString("So11111111111111111111111111111111111111112"), + Mint: common.NativeMint, Owner: common.PublicKeyFromString("27kVX7JpPZ1bsrSckbR76mV6GeRqtrjoddubfg2zBpHZ"), Amount: 1997960720, Delegate: nil, @@ -245,7 +245,7 @@ func TestDeserializeTokenAccount(t *testing.T) { accountOwner: common.TokenProgramID, }, want: TokenAccount{ - Mint: common.PublicKeyFromString("So11111111111111111111111111111111111111112"), + Mint: common.NativeMint, Owner: common.PublicKeyFromString("27kVX7JpPZ1bsrSckbR76mV6GeRqtrjoddubfg2zBpHZ"), Amount: 1997960720, Delegate: nil,