decred.org/dcrdex@v1.0.5/server/db/driver/pg/accounts_online_test.go (about) 1 //go:build pgonline 2 3 package pg 4 5 import ( 6 "testing" 7 8 "decred.org/dcrdex/server/account" 9 ) 10 11 var tPubKey = []byte{ 12 0x02, 0x04, 0x98, 0x8a, 0x49, 0x8d, 0x5d, 0x19, 0x51, 0x4b, 0x21, 0x7e, 0x87, 13 0x2b, 0x4d, 0xbd, 0x1c, 0xf0, 0x71, 0xd3, 0x65, 0xc4, 0x87, 0x9e, 0x64, 0xed, 14 0x59, 0x19, 0x88, 0x1c, 0x97, 0xeb, 0x19, 15 } 16 17 var tAcctID = account.AccountID{ 18 0x0a, 0x99, 0x12, 0x20, 0x5b, 0x2c, 0xba, 0xb0, 0xc2, 0x5c, 0x2d, 0xe3, 0x0b, 19 0xda, 0x90, 0x74, 0xde, 0x0a, 0xe2, 0x3b, 0x06, 0x54, 0x89, 0xa9, 0x91, 0x99, 20 0xba, 0xd7, 0x63, 0xf1, 0x02, 0xcc, 21 } 22 23 func tNewAccount(t *testing.T) *account.Account { 24 acct, err := account.NewAccountFromPubKey(tPubKey) 25 if err != nil { 26 t.Fatalf("error creating account from pubkey: %v", err) 27 } 28 if acct.ID != tAcctID { 29 t.Fatalf("unexpected account ID. wanted %x, got %x", tAcctID, acct.ID) 30 } 31 return acct 32 }