@@ -1979,6 +1979,51 @@ func TestCountOrders(t *testing.T) {
1979
1979
test .AssertEquals (t , count , 0 )
1980
1980
}
1981
1981
1982
+ func TestFasterGetOrderForNames (t * testing.T ) {
1983
+ sa , fc , cleanUp := initSA (t )
1984
+ defer cleanUp ()
1985
+
1986
+ domain := "example.com"
1987
+ expires := fc .Now ().Add (time .Hour )
1988
+
1989
+ reg , err := sa .NewRegistration (ctx , core.Registration {
1990
+ Key : satest .GoodJWK (),
1991
+ InitialIP : net .ParseIP ("42.42.42.42" ),
1992
+ })
1993
+ test .AssertNotError (t , err , "Couldn't create test registration" )
1994
+
1995
+ authz , err := sa .NewPendingAuthorization (ctx , core.Authorization {
1996
+ Identifier : identifier .DNSIdentifier (domain ),
1997
+ RegistrationID : reg .ID ,
1998
+ Status : core .StatusPending ,
1999
+ Expires : & expires ,
2000
+ })
2001
+ test .AssertNotError (t , err , "creating authorization" )
2002
+
2003
+ expiresNano := expires .UnixNano ()
2004
+ _ , err = sa .NewOrder (ctx , & corepb.Order {
2005
+ RegistrationID : & reg .ID ,
2006
+ Expires : & expiresNano ,
2007
+ Authorizations : []string {authz .ID },
2008
+ Names : []string {domain },
2009
+ })
2010
+ test .AssertNotError (t , err , "sa.NewOrder failed" )
2011
+
2012
+ _ , err = sa .NewOrder (ctx , & corepb.Order {
2013
+ RegistrationID : & reg .ID ,
2014
+ Expires : & expiresNano ,
2015
+ Authorizations : []string {authz .ID },
2016
+ Names : []string {domain },
2017
+ })
2018
+ test .AssertNotError (t , err , "sa.NewOrder failed" )
2019
+
2020
+ _ , err = sa .GetOrderForNames (ctx , & sapb.GetOrderForNamesRequest {
2021
+ AcctID : & reg .ID ,
2022
+ Names : []string {domain },
2023
+ })
2024
+ test .AssertNotError (t , err , "sa.GetOrderForNames failed" )
2025
+ }
2026
+
1982
2027
func TestGetOrderForNames (t * testing.T ) {
1983
2028
sa , fc , cleanUp := initSA (t )
1984
2029
defer cleanUp ()
0 commit comments