@@ -30,15 +30,15 @@ func TestCreate(t *testing.T) {
3030 collection := makeTestCollection (packs * slotsPerBucket )
3131
3232 dReq := pds_http.ReqCreateDistribution {
33- DistID : common.FlowID {Int64 : int64 (1 ), Valid : true },
33+ FlowID : common.FlowID {Int64 : int64 (1 ), Valid : true },
3434 Issuer : addr ,
35- PackTemplate : pds_http.PackTemplate {
35+ PackTemplate : pds_http.ReqPackTemplate {
3636 PackReference : pds_http.AddressLocation {
3737 Name : "TestPackNFT" ,
3838 Address : addr ,
3939 },
4040 PackCount : uint (packs ),
41- Buckets : []pds_http.Bucket {
41+ Buckets : []pds_http.ReqBucket {
4242 {
4343 CollectibleReference : pds_http.AddressLocation {
4444 Name : "TestCollectibleNFT" ,
@@ -79,13 +79,13 @@ func TestCreate(t *testing.T) {
7979 t .Fatal (err )
8080 }
8181
82- AssertNotEqual (t , createRes .DistributionId , uuid .Nil )
82+ AssertNotEqual (t , createRes .ID , uuid .Nil )
8383
8484 // Get
8585
8686 rr2 := httptest .NewRecorder ()
8787
88- getReq , err := http .NewRequest ("GET" , fmt .Sprintf ("/v1/distributions/%s" , createRes .DistributionId ), nil )
88+ getReq , err := http .NewRequest ("GET" , fmt .Sprintf ("/v1/distributions/%s" , createRes .ID ), nil )
8989 if err != nil {
9090 t .Fatal (err )
9191 }
@@ -97,14 +97,11 @@ func TestCreate(t *testing.T) {
9797 t .Fatalf ("handler returned wrong status code: got %v want %v, error: %s" , status , http .StatusOK , rr2 .Body )
9898 }
9999
100- getRes := pds_http.ResDistribution {}
100+ getRes := pds_http.ResGetDistribution {}
101101 if err := json .NewDecoder (rr2 .Body ).Decode (& getRes ); err != nil {
102102 t .Fatal (err )
103103 }
104104
105- AssertEqual (t , getRes .ID , createRes .DistributionId )
105+ AssertEqual (t , getRes .ID , createRes .ID )
106106 AssertEqual (t , getRes .Issuer , addr )
107- AssertEqual (t , len (getRes .ResolvedCollection ), len (collection ))
108- AssertEqual (t , len (getRes .Packs ), packs )
109- AssertEqual (t , getRes .Packs [0 ].CommitmentHash .IsEmpty (), false )
110107}
0 commit comments