Skip to content

Commit

Permalink
Add intType
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Dusek committed Jun 10, 2024
1 parent c94ee48 commit 25c21aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testutil/nullify/nullify.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
var (
coinType = reflect.TypeOf(sdk.Coin{})
coinsType = reflect.TypeOf(sdk.Coins{})
intType = reflect.TypeOf(sdk.NewIntFromUint64(1))
)

// Fill analyze all struct fields and slices with
Expand Down Expand Up @@ -45,6 +46,10 @@ func Fill(x interface{}) interface{} {
coins := reflect.New(coinsType).Interface()
s := reflect.ValueOf(coins).Elem()
f.Set(s)
case intType:
int := reflect.New(intType).Interface()
s := reflect.ValueOf(int).Elem()
f.Set(s)
default:
objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface()
s := Fill(objPt)
Expand Down

0 comments on commit 25c21aa

Please sign in to comment.