功能增加
This commit is contained in:
1 parent
b340fc7ad7
commit
f1993eb388
69 files changed
+2243
-162
No files matched your search
@@ -31,6 +31,29 @@ func TestSeedanceActualAmountUsesFrozenTokenPricingAndRoundsUp(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMinimaxH3ActualAmountUsesOfficialPerSecondPricingAndMarkup(t *testing.T) {
|
||||
tests := []struct {
|
||||
resolution string
|
||||
outputSeconds int64
|
||||
inputVideoSeconds int64
|
||||
inputImageCount int64
|
||||
want int64
|
||||
}{
|
||||
{resolution: "768P", outputSeconds: 5, inputImageCount: 1, want: 300},
|
||||
{resolution: "2K", outputSeconds: 5, inputImageCount: 1, want: 480},
|
||||
{resolution: "2k", outputSeconds: 4, inputVideoSeconds: 2, inputImageCount: 7, want: 624},
|
||||
}
|
||||
for _, test := range tests {
|
||||
got, err := CalculateMinimaxH3ActualAmountFen(MinimaxH3ActualAmountInput{
|
||||
Resolution: test.resolution, OutputSeconds: test.outputSeconds, InputVideoSeconds: test.inputVideoSeconds,
|
||||
InputImageCount: test.inputImageCount, MarkupMultiplier: 1.2,
|
||||
})
|
||||
if err != nil || got != test.want {
|
||||
t.Fatalf("resolution=%s amount=%d err=%v want=%d", test.resolution, got, err, test.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLedgerSettlesSeedanceDeltaWithOneFrozenIdempotencyKey(t *testing.T) {
|
||||
poster := &recordingPoster{result: WalletPosting{LedgerID: "settlement-ledger", CreatedAt: time.Unix(7, 0)}}
|
||||
ledger := Ledger{Poster: poster, NewID: func() string { return "new-ledger" }}
|
||||
|
||||
Reference in new issue
Block a user