Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy types #292

Merged
merged 23 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
types: Fix lint errors
  • Loading branch information
cdamian committed Sep 12, 2022
commit f5d41e3eaaaa17f890c99bc8772b5ca1f7af922d
2 changes: 1 addition & 1 deletion types/event_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ func (e EventRecordsRaw) DecodeEventRecords(m *Metadata, t interface{}) error {
return fmt.Errorf("unable to find event with EventID %v in metadata for event #%v: %s", id, i, err)
}

//fmt.Printf("event #%v is in module %v with event name %v\n", i, moduleName, eventName)
// fmt.Printf("event #%v is in module %v with event name %v\n", i, moduleName, eventName)

log.Debug(fmt.Sprintf("event #%v is in module %v with event name %v", i, moduleName, eventName))

Expand Down
16 changes: 8 additions & 8 deletions types/test_utils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package test_utils
package testutils

import (
"bytes"
Expand All @@ -23,7 +23,7 @@ import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/v4/scale"
. "github.com/centrifuge/go-substrate-rpc-client/v4/types/codec"
"github.com/centrifuge/go-substrate-rpc-client/v4/types/codec"
fuzz "github.com/google/gofuzz"
"github.com/stretchr/testify/assert"
"golang.org/x/crypto/blake2b"
Expand Down Expand Up @@ -122,7 +122,7 @@ func AssertRoundtrip(t *testing.T, value interface{}) {

func AssertEncodedLength(t *testing.T, encodedLengthAsserts []EncodedLengthAssert) {
for _, test := range encodedLengthAsserts {
result, err := EncodedLength(test.Input)
result, err := codec.EncodedLength(test.Input)
if err != nil {
t.Errorf("Encoded length error for input %v: %v\n", test.Input, err)
}
Expand All @@ -139,7 +139,7 @@ type EncodingAssert struct {

func AssertEncode(t *testing.T, encodingAsserts []EncodingAssert) {
for _, test := range encodingAsserts {
result, err := Encode(test.Input)
result, err := codec.Encode(test.Input)
if err != nil {
t.Errorf("Encoding error for input %v: %v\n", test.Input, err)
}
Expand All @@ -158,7 +158,7 @@ type DecodingAssert struct {
func AssertDecode(t *testing.T, decodingAsserts []DecodingAssert) {
for _, test := range decodingAsserts {
target := reflect.New(reflect.TypeOf(test.Expected))
err := Decode(test.Input, target.Interface())
err := codec.Decode(test.Input, target.Interface())
if err != nil {
t.Errorf("Encoding error for input %v: %v\n", test.Input, err)
}
Expand All @@ -173,7 +173,7 @@ type HashAssert struct {

func AssertHash(t *testing.T, hashAsserts []HashAssert) {
for _, test := range hashAsserts {
enc, err := Encode(test.Input)
enc, err := codec.Encode(test.Input)

if err != nil {
t.Errorf("Couldn't encode input %v: %s", test.Input, err)
Expand All @@ -194,7 +194,7 @@ type EncodeToHexAssert struct {

func AssertEncodeToHex(t *testing.T, encodeToHexAsserts []EncodeToHexAssert) {
for _, test := range encodeToHexAsserts {
result, err := EncodeToHex(test.Input)
result, err := codec.EncodeToHex(test.Input)
if err != nil {
t.Errorf("Hex error for input %v: %v\n", test.Input, err)
}
Expand Down Expand Up @@ -226,7 +226,7 @@ type EqAssert struct {

func AssertEq(t *testing.T, eqAsserts []EqAssert) {
for _, test := range eqAsserts {
result := Eq(test.Input, test.Other)
result := codec.Eq(test.Input, test.Other)
if result != test.Expected {
t.Errorf("Fail, input %v, other %v, expected %v, result %v\n", test.Input, test.Other, test.Expected, result)
}
Expand Down