From 0ce78b2ef54f9d42c0949dd454de824d9cdca3a6 Mon Sep 17 00:00:00 2001 From: Lee ByeongJun Date: Fri, 5 Apr 2024 18:12:07 +0900 Subject: [PATCH] remove deprecated method --- gnovm/pkg/gnolang/gonative.go | 4 ++-- gnovm/pkg/gnolang/op_expressions.go | 2 +- gnovm/pkg/gnolang/op_types.go | 6 +++--- gnovm/pkg/gnolang/preprocess.go | 6 +++--- gnovm/pkg/gnolang/types.go | 2 +- tm2/pkg/amino/codec.go | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gnovm/pkg/gnolang/gonative.go b/gnovm/pkg/gnolang/gonative.go index 4cd39858300..f73a5c58962 100644 --- a/gnovm/pkg/gnolang/gonative.go +++ b/gnovm/pkg/gnolang/gonative.go @@ -129,7 +129,7 @@ func (ds *defaultStore) Go2GnoType(rt reflect.Type) (t Type) { // for methods with ptr receivers, // whereas gno methods are all // declared on the *DeclaredType. - prt = reflect.PtrTo(rt) + prt = reflect.PointerTo(rt) } nm := prt.NumMethod() mtvs = make([]TypedValue, nm) @@ -825,7 +825,7 @@ func gno2GoType(t Type) reflect.Type { } case *PointerType: et := gno2GoType(ct.Elem()) - return reflect.PtrTo(et) + return reflect.PointerTo(et) case *ArrayType: ne := ct.Len et := gno2GoType(ct.Elem()) diff --git a/gnovm/pkg/gnolang/op_expressions.go b/gnovm/pkg/gnolang/op_expressions.go index b3bf240aea1..59a36c70e45 100644 --- a/gnovm/pkg/gnolang/op_expressions.go +++ b/gnovm/pkg/gnolang/op_expressions.go @@ -163,7 +163,7 @@ func (m *Machine) doOpStar() { t := xv.GetType() var pt Type if nt, ok := t.(*NativeType); ok { - pt = &NativeType{Type: reflect.PtrTo(nt.Type)} + pt = &NativeType{Type: reflect.PointerTo(nt.Type)} } else { pt = &PointerType{Elt: t} } diff --git a/gnovm/pkg/gnolang/op_types.go b/gnovm/pkg/gnolang/op_types.go index a38010bac4e..f89fd8d5600 100644 --- a/gnovm/pkg/gnolang/op_types.go +++ b/gnovm/pkg/gnolang/op_types.go @@ -405,7 +405,7 @@ func (m *Machine) doOpStaticTypeOf() { "VPNative access on pointer to non-native value %v", pt.Elt)) } dxt = &NativeType{ - Type: reflect.PtrTo(net.Type), + Type: reflect.PointerTo(net.Type), } } // switch on type and maybe match field. @@ -431,10 +431,10 @@ func (m *Machine) doOpStaticTypeOf() { return } // make rt ptr. - rt = reflect.PtrTo(rt) + rt = reflect.PointerTo(rt) } else { // make rt ptr. - rt = reflect.PtrTo(rt) + rt = reflect.PointerTo(rt) } // match method. rmt, ok := rt.MethodByName(string(x.Sel)) diff --git a/gnovm/pkg/gnolang/preprocess.go b/gnovm/pkg/gnolang/preprocess.go index dcb1b0856ca..2efa718b613 100644 --- a/gnovm/pkg/gnolang/preprocess.go +++ b/gnovm/pkg/gnolang/preprocess.go @@ -2453,7 +2453,7 @@ func checkType(xt Type, dt Type, autoNative bool) { nidt.String())) } // if xt has native base, do the naive native. - if reflect.PtrTo(nxt.Type).AssignableTo(nidt) { + if reflect.PointerTo(nxt.Type).AssignableTo(nidt) { return // ok } else { panic(fmt.Sprintf( @@ -2478,7 +2478,7 @@ func checkType(xt Type, dt Type, autoNative bool) { //nolint:misspell if enxt, ok := pxt.Elt.(*NativeType); ok { xt = &NativeType{ - Type: reflect.PtrTo(enxt.Type), + Type: reflect.PointerTo(enxt.Type), } } } @@ -2486,7 +2486,7 @@ func checkType(xt Type, dt Type, autoNative bool) { // *gonative{x} is gonative{*x} if endt, ok := pdt.Elt.(*NativeType); ok { dt = &NativeType{ - Type: reflect.PtrTo(endt.Type), + Type: reflect.PointerTo(endt.Type), } } } diff --git a/gnovm/pkg/gnolang/types.go b/gnovm/pkg/gnolang/types.go index 34565b7a1b6..e1814e8f243 100644 --- a/gnovm/pkg/gnolang/types.go +++ b/gnovm/pkg/gnolang/types.go @@ -696,7 +696,7 @@ func (pt *PointerType) FindEmbeddedFieldType(callerPath string, n Name, m map[Ty } case *NativeType: npt := &NativeType{ - Type: reflect.PtrTo(cet.Type), + Type: reflect.PointerTo(cet.Type), } return npt.FindEmbeddedFieldType(n, m) default: diff --git a/tm2/pkg/amino/codec.go b/tm2/pkg/amino/codec.go index 602c7090d91..3fa7634e3ad 100644 --- a/tm2/pkg/amino/codec.go +++ b/tm2/pkg/amino/codec.go @@ -594,7 +594,7 @@ func (cdc *Codec) newTypeInfoUnregisteredWLocked(rt reflect.Type) *TypeInfo { cdc.typeInfos[rt] = info info.Type = rt - info.PtrToType = reflect.PtrTo(rt) + info.PtrToType = reflect.PointerTo(rt) info.ZeroValue = reflect.Zero(rt) var isAminoMarshaler bool var reprType reflect.Type @@ -602,7 +602,7 @@ func (cdc *Codec) newTypeInfoUnregisteredWLocked(rt reflect.Type) *TypeInfo { isAminoMarshaler = true reprType = marshalAminoReprType(rm) } - if rm, ok := reflect.PtrTo(rt).MethodByName("UnmarshalAmino"); ok { + if rm, ok := reflect.PointerTo(rt).MethodByName("UnmarshalAmino"); ok { if !isAminoMarshaler { panic("Must implement both (o).MarshalAmino and (*o).UnmarshalAmino") }