Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion api/comms_blasts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,22 @@ func TestGetNewBlasts(t *testing.T) {
},
{
"track_id": 2,
"owner_id": 2,
"owner_id": 1,
"title": "Remix Track",
"created_at": now.Add(-time.Minute * 10),
"updated_at": now.Add(-time.Minute * 10),
},
{
// Owned by user 2 so user 2 qualifies as a remixer of track 1.
// Track 2 is now owned by artist1 (so v_usdc_purchases reports
// user 1 as the seller for customer_audience filtering), which
// previously was what made user 2 a remixer.
"track_id": 3,
"owner_id": 2,
"title": "Fan Remix",
"created_at": now.Add(-time.Minute * 10),
"updated_at": now.Add(-time.Minute * 10),
},
},
"follows": {
{
Expand Down Expand Up @@ -96,6 +107,11 @@ func TestGetNewBlasts(t *testing.T) {
"parent_track_id": 1,
"child_track_id": 2,
},
{
// Makes user 2 (owner of track 3) a remixer of track 1.
"parent_track_id": 1,
"child_track_id": 3,
},
},
"sol_purchases": {
{"signature": "purchase_sig_123", "instruction_index": 0, "buyer_user_id": 2, "content_type": "track", "content_id": 1, "amount": 1000000, "created_at": now.Add(-time.Hour * 2), "slot": 101, "is_valid": true},
Expand Down
4 changes: 2 additions & 2 deletions api/v1_users_purchases_download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestV1UsersPurchasesDownload(t *testing.T) {
},
// Drives extra_amount = 500000 (amount=1000000 - base_price=50_cents*10000=500000)
"track_price_history": []map[string]any{
{"track_id": 1, "total_price_cents": 50, "blocknumber": 100, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
{"track_id": 1, "total_price_cents": 50, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
},
}

Expand Down Expand Up @@ -163,7 +163,7 @@ func TestV1UsersPurchasesDownloadWithGrantee(t *testing.T) {
{"signature": "def", "instruction_index": 0, "route_index": 1, "to_account": app.solanaConfig.StakingBridgeUsdcTokenAccount.String(), "amount": 100000, "slot": 101},
},
"track_price_history": []map[string]any{
{"track_id": 1, "total_price_cents": 50, "blocknumber": 100, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
{"track_id": 1, "total_price_cents": 50, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
},
"grants": []map[string]any{
{
Expand Down
2 changes: 1 addition & 1 deletion api/v1_users_purchases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestV1UsersPurchases(t *testing.T) {
// For the purchase with non-zero extra_amount (signature "abc"), seed a track_price_history
// row so the view's amount - base_price computation produces extra_amount = 1000000.
"track_price_history": []map[string]any{
{"track_id": 1, "total_price_cents": 0, "blocknumber": 100, "block_timestamp": time.Date(2024, 6, 2, 23, 0, 0, 0, time.UTC), "splits": "[]"},
{"track_id": 1, "total_price_cents": 0, "block_timestamp": time.Date(2024, 6, 2, 23, 0, 0, 0, time.UTC), "splits": "[]"},
},
"sol_purchases": []map[string]any{
{
Expand Down
4 changes: 2 additions & 2 deletions api/v1_users_sales_download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestV1UsersSalesDownload(t *testing.T) {
{"signature": "def", "instruction_index": 0, "route_index": 1, "to_account": app.solanaConfig.StakingBridgeUsdcTokenAccount.String(), "amount": 100000, "slot": 101},
},
"track_price_history": []map[string]any{
{"track_id": 1, "total_price_cents": 50, "blocknumber": 100, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
{"track_id": 1, "total_price_cents": 50, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
},
"encrypted_emails": []map[string]any{
{
Expand Down Expand Up @@ -193,7 +193,7 @@ func TestV1UsersSalesDownloadWithGrantee(t *testing.T) {
{"signature": "def", "instruction_index": 0, "route_index": 1, "to_account": app.solanaConfig.StakingBridgeUsdcTokenAccount.String(), "amount": 100000, "slot": 101},
},
"track_price_history": []map[string]any{
{"track_id": 1, "total_price_cents": 50, "blocknumber": 100, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
{"track_id": 1, "total_price_cents": 50, "block_timestamp": time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC), "splits": "[]"},
},
"encrypted_emails": []map[string]any{
{
Expand Down
2 changes: 1 addition & 1 deletion api/v1_users_sales_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestV1UsersSales(t *testing.T) {
},
"track_price_history": []map[string]any{
// Drives extra_amount = 1000000 for signature "abc" (amount=1000000, base_price=0)
{"track_id": 1, "total_price_cents": 0, "blocknumber": 100, "block_timestamp": time.Date(2024, 6, 2, 23, 0, 0, 0, time.UTC), "splits": "[]"},
{"track_id": 1, "total_price_cents": 0, "block_timestamp": time.Date(2024, 6, 2, 23, 0, 0, 0, time.UTC), "splits": "[]"},
},
"sol_purchases": []map[string]any{
{"signature": "gfsgf", "instruction_index": 0, "buyer_user_id": 5, "amount": 2000000, "content_type": "playlist", "content_id": 1, "created_at": time.Date(2024, 6, 1, 0, 0, 0, 0, time.UTC), "is_valid": true},
Expand Down
Loading