test: fix macOS path assertion and wallet address unique index
This commit is contained in:
@@ -67,8 +67,27 @@ func TestResolveConfigFilePathUsesCurrentDirectoryByDefault(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("resolve config path: %v", err)
|
t.Fatalf("resolve config path: %v", err)
|
||||||
}
|
}
|
||||||
if got != configPath {
|
|
||||||
t.Fatalf("config path = %s, want %s", got, configPath)
|
gotAbs, err := filepath.Abs(got)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("abs got: %v", err)
|
||||||
|
}
|
||||||
|
wantAbs, err := filepath.Abs(configPath)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("abs want: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
gotReal, err := filepath.EvalSymlinks(gotAbs)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("eval symlinks got: %v", err)
|
||||||
|
}
|
||||||
|
wantReal, err := filepath.EvalSymlinks(wantAbs)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("eval symlinks want: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if gotReal != wantReal {
|
||||||
|
t.Fatalf("config path = %s, want %s", gotReal, wantReal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const (
|
|||||||
|
|
||||||
type WalletAddress struct {
|
type WalletAddress struct {
|
||||||
Network string `gorm:"column:network;uniqueIndex:wallet_address_network_address_uindex" json:"network"`
|
Network string `gorm:"column:network;uniqueIndex:wallet_address_network_address_uindex" json:"network"`
|
||||||
Address string `gorm:"column:address;uniqueIndex:wallet_address_address_uindex" json:"address"`
|
Address string `gorm:"column:address;uniqueIndex:wallet_address_network_address_uindex" json:"address"`
|
||||||
Status int64 `gorm:"column:status;default:1" json:"status"`
|
Status int64 `gorm:"column:status;default:1" json:"status"`
|
||||||
BaseModel
|
BaseModel
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func TestParseSolTransaction(t *testing.T) {
|
func TestParseSolTransaction(t *testing.T) {
|
||||||
client := rpc.New("https://api.mainnet-beta.solana.com")
|
client := rpc.New("https://api.mainnet-beta.solana.com")
|
||||||
sig := ""
|
sig := "3tZTwLrvmiZ59h4UzyMHPd7DPux7t9eXZgkUvEfquaoSuERrPSRNzWuSHKQM2fbiCWFDGNqoLpu2kLZnfoegVpqN"
|
||||||
|
|
||||||
txInfo, err := ParseTransactionTransfers(context.Background(), client, sig)
|
txInfo, err := ParseTransactionTransfers(context.Background(), client, sig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -33,7 +33,7 @@ func TestParseSolTransaction(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFindATAAddress(t *testing.T) {
|
func TestFindATAAddress(t *testing.T) {
|
||||||
owner := ""
|
owner := "2uFTf9TZ8gd7Kg6hkb79TxfaeNpaAgpJ8uVHguv2Yweu"
|
||||||
mint := "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" // ray token
|
mint := "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" // ray token
|
||||||
|
|
||||||
ata, err := FindATAAddress(owner, mint)
|
ata, err := FindATAAddress(owner, mint)
|
||||||
|
|||||||
Reference in New Issue
Block a user