@@ -368,9 +368,9 @@ func (outputs Outputs) NativeTokenSum() (NativeTokenSum, int, error) {
368368 sum := make (map [NativeTokenID ]* big.Int )
369369 var ntCount int
370370 for _ , output := range outputs {
371- set := output .NativeTokenSet ()
372- ntCount += len (set )
373- for _ , nativeToken := range set {
371+ nativeTokens := output .NativeTokenList ()
372+ ntCount += len (nativeTokens )
373+ for _ , nativeToken := range nativeTokens {
374374 if sign := nativeToken .Amount .Sign (); sign == - 1 || sign == 0 {
375375 return nil , 0 , ErrNativeTokenAmountLessThanEqualZero
376376 }
@@ -585,8 +585,8 @@ type Output interface {
585585 // Deposit returns the amount this Output deposits.
586586 Deposit () uint64
587587
588- // NativeTokenSet returns the NativeToken this output defines.
589- NativeTokenSet () NativeTokens
588+ // NativeTokenList returns the NativeToken this output defines.
589+ NativeTokenList () NativeTokens
590590
591591 // UnlockConditionSet returns the UnlockConditionSet this output defines.
592592 UnlockConditionSet () UnlockConditionSet
@@ -752,13 +752,13 @@ func OutputsSyntacticalDepositAmount(protoParas *ProtocolParameters) OutputsSynt
752752func OutputsSyntacticalNativeTokens () OutputsSyntacticalValidationFunc {
753753 var nativeTokensCount int
754754 return func (index int , output Output ) error {
755- set := output .NativeTokenSet ()
756- nativeTokensCount += len (set )
755+ nativeTokens := output .NativeTokenList ()
756+ nativeTokensCount += len (nativeTokens )
757757 if nativeTokensCount > MaxNativeTokensCount {
758758 return ErrMaxNativeTokensCountExceeded
759759 }
760760
761- for i , nt := range set {
761+ for i , nt := range nativeTokens {
762762 if nt .Amount .Cmp (common .Big0 ) == 0 {
763763 return fmt .Errorf ("%w: output %d, native token index %d" , ErrNativeTokenAmountLessThanEqualZero , index , i )
764764 }
0 commit comments