gomcaptcha/gomcaptcha_test.go

24 lines
548 B
Go

// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
package gomcaptcha
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGoMcaptcha(t *testing.T) {
salt := "56126a526f6f1e6728e904d8b574ebb8"
phrase := "ef055efeac72b99ed24af687e49d6ec7"
difficulty := uint(50000)
res := ProveWork(salt, phrase, difficulty)
assert.True(t, res.IsSufficientDifficulty(salt, difficulty))
assert.True(t, res.IsValidProof(phrase, salt))
}