Update abstore.go parameter judgment when the transaction

Signed-off-by: yjwxfq <112159687+yjwxfq@users.noreply.github.com>
This commit is contained in:
yjwxfq 2023-05-31 17:25:04 +08:00 committed by GitHub
parent 9169301edc
commit c7a50fbe74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,7 @@ func (t *ABstore) Init(ctx contractapi.TransactionContextInterface, A string, Av
// Transaction makes payment of X units from A to B // Transaction makes payment of X units from A to B
func (t *ABstore) Invoke(ctx contractapi.TransactionContextInterface, A, B string, X int) error { func (t *ABstore) Invoke(ctx contractapi.TransactionContextInterface, A, B string, X int) error {
if X < 0 { if X <= 0 {
return fmt.Errorf("X input is wrong, it should be greater than 0") return fmt.Errorf("X input is wrong, it should be greater than 0")
} }
var err error var err error