mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
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 {
|
||||
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 {
|
||||
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"`
|
||||
BaseModel
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func TestParseSolTransaction(t *testing.T) {
|
||||
client := rpc.New("https://api.mainnet-beta.solana.com")
|
||||
sig := ""
|
||||
sig := "3tZTwLrvmiZ59h4UzyMHPd7DPux7t9eXZgkUvEfquaoSuERrPSRNzWuSHKQM2fbiCWFDGNqoLpu2kLZnfoegVpqN"
|
||||
|
||||
txInfo, err := ParseTransactionTransfers(context.Background(), client, sig)
|
||||
if err != nil {
|
||||
@@ -33,7 +33,7 @@ func TestParseSolTransaction(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFindATAAddress(t *testing.T) {
|
||||
owner := ""
|
||||
owner := "2uFTf9TZ8gd7Kg6hkb79TxfaeNpaAgpJ8uVHguv2Yweu"
|
||||
mint := "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" // ray token
|
||||
|
||||
ata, err := FindATAAddress(owner, mint)
|
||||
|
||||
Reference in New Issue
Block a user