File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
token/core/fabtoken/v1/setup Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,9 @@ func (p *PublicParams) Validate() error {
229229 if p .MaxToken > maxTokenValue {
230230 return errors .Errorf ("max token value is invalid [%d]>[%d]" , p .MaxToken , maxTokenValue )
231231 }
232+ if len (p .IssuerIDs ) == 0 {
233+ return errors .New ("invalid public parameters: empty list of issuers" )
234+ }
232235 return nil
233236}
234237
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ package setup
99import (
1010 "testing"
1111
12+ "github.com/hyperledger-labs/fabric-token-sdk/token/driver"
1213 "github.com/stretchr/testify/assert"
1314)
1415
@@ -47,6 +48,7 @@ func TestPublicParams_Validate_Valid(t *testing.T) {
4748 Label : "fabtoken" ,
4849 QuantityPrecision : 32 ,
4950 MaxToken : 1 << 32 - 1 ,
51+ IssuerIDs : []driver.Identity {[]byte ("issuer1" ), []byte ("issuer2" )},
5052 }
5153 err := pp .Validate ()
5254 assert .NoError (t , err )
You can’t perform that action at this time.
0 commit comments