Skip to content

Commit e42fdd2

Browse files
authored
Merge pull request #28 from ipfs-force-community/feat/new_template_cmd
Feat/new template cmd
2 parents 4e719f2 + cbf0095 commit e42fdd2

File tree

19 files changed

+384
-139
lines changed

19 files changed

+384
-139
lines changed

Cargo.lock

+57-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/erc20/client/client.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package client
22

33
import (
4-
bytes "bytes"
5-
context "context"
4+
"bytes"
5+
"context"
66
contract "erc20/contract"
7-
fmt "fmt"
7+
"fmt"
88

99
address "github.com/filecoin-project/go-address"
1010
abi "github.com/filecoin-project/go-state-types/abi"
@@ -13,7 +13,7 @@ import (
1313
init8 "github.com/filecoin-project/specs-actors/v8/actors/builtin/init"
1414
actors "github.com/filecoin-project/venus/venus-shared/actors"
1515
types "github.com/filecoin-project/venus/venus-shared/types"
16-
types2 "github.com/ipfs-force-community/go-fvm-sdk/sdk/types"
16+
sdkTypes "github.com/ipfs-force-community/go-fvm-sdk/sdk/types"
1717
cid "github.com/ipfs/go-cid"
1818
typegen "github.com/whyrusleeping/cbor-gen"
1919

@@ -31,9 +31,9 @@ type IErc20TokenClient interface {
3131

3232
Constructor(context.Context, *contract.ConstructorReq) error
3333

34-
GetName(context.Context) (types2.CborString, error)
34+
GetName(context.Context) (sdkTypes.CborString, error)
3535

36-
GetSymbol(context.Context) (types2.CborString, error)
36+
GetSymbol(context.Context) (sdkTypes.CborString, error)
3737

3838
GetDecimal(context.Context) (typegen.CborInt, error)
3939

@@ -208,7 +208,7 @@ func (c *Erc20TokenClient) Constructor(ctx context.Context, p0 *contract.Constru
208208
return nil
209209
}
210210

211-
func (c *Erc20TokenClient) GetName(ctx context.Context) (types2.CborString, error) {
211+
func (c *Erc20TokenClient) GetName(ctx context.Context) (sdkTypes.CborString, error) {
212212
if c.actor == address.Undef {
213213
return "", fmt.Errorf("unset actor address for call")
214214
}
@@ -239,14 +239,14 @@ func (c *Erc20TokenClient) GetName(ctx context.Context) (types2.CborString, erro
239239
return "", fmt.Errorf("expect get result for call")
240240
}
241241

242-
result := new(types2.CborString)
242+
result := new(sdkTypes.CborString)
243243
result.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return))
244244

245245
return *result, nil
246246

247247
}
248248

249-
func (c *Erc20TokenClient) GetSymbol(ctx context.Context) (types2.CborString, error) {
249+
func (c *Erc20TokenClient) GetSymbol(ctx context.Context) (sdkTypes.CborString, error) {
250250
if c.actor == address.Undef {
251251
return "", fmt.Errorf("unset actor address for call")
252252
}
@@ -277,7 +277,7 @@ func (c *Erc20TokenClient) GetSymbol(ctx context.Context) (types2.CborString, er
277277
return "", fmt.Errorf("expect get result for call")
278278
}
279279

280-
result := new(types2.CborString)
280+
result := new(sdkTypes.CborString)
281281
result.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return))
282282

283283
return *result, nil

examples/erc20/entry.go

+12-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/erc20/gen/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ require (
2929
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
3030
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
3131
github.com/minio/sha256-simd v1.0.0 // indirect
32+
github.com/modern-go/reflect2 v1.0.2 // indirect
3233
github.com/mr-tron/base58 v1.2.0 // indirect
3334
github.com/multiformats/go-base32 v0.0.3 // indirect
3435
github.com/multiformats/go-base36 v0.1.0 // indirect

examples/erc20/gen/go.sum

+1
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
12831283
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
12841284
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
12851285
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
1286+
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
12861287
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
12871288
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
12881289
github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=

0 commit comments

Comments
 (0)