Skip to content

Commit

Permalink
Base p2p (#49)
Browse files Browse the repository at this point in the history
* update CompareSlice and SubmitIdleMetadata

* update p2p to v0.0.22

* add CESSTokenDecimals
  • Loading branch information
AstaFrode committed May 16, 2023
1 parent 1afa3e5 commit 2705211
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
7 changes: 1 addition & 6 deletions core/chain/fileBank.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,7 @@ func (c *chainClient) SubmitIdleMetadata(teeAcc []byte, idlefiles []IdleMetadata
return txhash, errors.Wrap(err, "[NewAccountID]")
}

owner, err := codec.Encode(*acc)
if err != nil {
return txhash, errors.Wrap(err, "[EncodeToBytes]")
}

call, err := types.NewCall(c.metadata, TX_FILEBANK_UPLOADFILLER, owner, idlefiles)
call, err := types.NewCall(c.metadata, TX_FILEBANK_UPLOADFILLER, *acc, idlefiles)
if err != nil {
return txhash, errors.Wrap(err, "[NewCall]")
}
Expand Down
2 changes: 1 addition & 1 deletion core/chain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func CompareSlice(s1, s2 []byte) bool {
return false
}
for i := 0; i < len(s1); i++ {
if s1[i] != s2[2] {
if s1[i] != s2[i] {
return false
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/rule/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ const BlockInterval = time.Second * time.Duration(6)
// CESSTokenSymbol is the symbol of the CESS token
const CESSTokenSymbol = "TCESS"

const CESSTokenDecimals = "000000000000"

const MaxSubmitedIdleFileMeta = 30
5 changes: 0 additions & 5 deletions core/rule/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@
package rule

const DirMode = 0644

const FileDir = "file"
const TempDir = "tmp"
const TagDir = "tag"
const MusDir = "mu"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/CESSProject/sdk-go
go 1.19

require (
github.com/CESSProject/p2p-go v0.0.21
github.com/CESSProject/p2p-go v0.0.22
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cbergoon/merkletree v0.2.0
github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSu
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CESSProject/p2p-go v0.0.21 h1:ZRNIwufHU6x4Kzryt3dZNaDWrnR0baeoJYZGZJaLl6w=
github.com/CESSProject/p2p-go v0.0.21/go.mod h1:Ur2x/oD/oxteLGrEQ1hK3ZZwEZ3H8ta3cLP2zFxB96Y=
github.com/CESSProject/p2p-go v0.0.22 h1:87fY0zj60SBK1M2kLKL5VnQJ5/vwiNik3MkzisyWii4=
github.com/CESSProject/p2p-go v0.0.22/go.mod h1:Ur2x/oD/oxteLGrEQ1hK3ZZwEZ3H8ta3cLP2zFxB96Y=
github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM=
github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
Expand Down

0 comments on commit 2705211

Please sign in to comment.