Skip to content

Commit

Permalink
Add signature verification check to asset transfer transaction test.
Browse files Browse the repository at this point in the history
  • Loading branch information
LINCKODE authored and 0xluk committed Feb 10, 2025
1 parent 24fac98 commit ba93301
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions types/tx_asset_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"bytes"
"encoding/binary"
"github.com/qubic/go-schnorrq"
"testing"
)

Expand Down Expand Up @@ -67,6 +68,16 @@ func TestAssetTransaction(t *testing.T) {
t.Fatalf("signing asset transfer transaction: %s", err)
}

unsignedDigest, err := assetTransferTransaction.GetUnsignedDigest()
if err != nil {
t.Fatalf("getting unsigned digest for asset transfer transaction")
}

err = schnorrq.Verify(assetTransferTransaction.SourcePublicKey, unsignedDigest, assetTransferTransaction.Signature)
if err != nil {
t.Fatalf("verifying asset transfer transaction signature: %s", err)
}

})
}
}
Expand Down

0 comments on commit ba93301

Please sign in to comment.