Skip to content

Commit

Permalink
ic fastrlp
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcrevar committed May 3, 2023
1 parent ad0b2d4 commit 1873d4f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 8 additions & 9 deletions consensus/polybft/stake_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,14 @@ func Test_MarshalBug(t *testing.T) {
return ar.NewUint(intOfCorruption)
}

marshal(marshalOne)

for i := 0; i < 8; i++ {
require.Equal(t, byte(0), corruptedSlice[i])
check := func() {
for i := 0; i < 8; i++ {
require.Equal(t, byte(0), corruptedSlice[i])
}
}

marshal(marshalTwo)

for i := 0; i < 8; i++ {
require.Equal(t, byte(0), corruptedSlice[i])
}
marshal(marshalOne)
check()
marshal(marshalTwo) // without fixing this, marshaling will cause corruption of the corrupted slice
check()
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,5 @@ require (
gotest.tools/v3 v3.0.2 // indirect
inet.af/netaddr v0.0.0-20220617031823-097006376321 // indirect
)

replace github.com/umbracle/fastrlp => github.com/igorcrevar/fastrlp v0.0.0-20230503111411-4717b7e20c16
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ=
github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/igorcrevar/fastrlp v0.0.0-20230503111411-4717b7e20c16 h1:V48deMz/8zv8Cc/7kLjkTiaHz6Y1D3ZI7rQw0b0QRVs=
github.com/igorcrevar/fastrlp v0.0.0-20230503111411-4717b7e20c16/go.mod h1:5RHgqiFjd4vLJESMWagP/E7su+5Gzk0iqqmrotR8WdA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
Expand Down Expand Up @@ -678,8 +680,6 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/umbracle/ethgo v0.1.4-0.20230326234627-15b1df435098 h1:OXYAHR6AKpV2A/BjQNECXod9rR8r5XOT2QCakD2r0YQ=
github.com/umbracle/ethgo v0.1.4-0.20230326234627-15b1df435098/go.mod h1:bjxSp984qsxCStKoKjqz5fgugi4uWj6+/tFkSEpjk3A=
github.com/umbracle/fastrlp v0.1.0 h1:V0W3f6ZKWqbu1KggdhnRWOi+t7+PfL3VyAffJqayI5s=
github.com/umbracle/fastrlp v0.1.0/go.mod h1:5RHgqiFjd4vLJESMWagP/E7su+5Gzk0iqqmrotR8WdA=
github.com/umbracle/go-eth-bn256 v0.0.0-20230125114011-47cb310d9b0b h1:5/xofhZiOG0I9DQXqDSPxqYObk6QI7mBGMJI+ngyIgc=
github.com/umbracle/go-eth-bn256 v0.0.0-20230125114011-47cb310d9b0b/go.mod h1:H8SeC2PWEciymT92Mt07Qcfjr2FMEuCz/V+KPtPTy+U=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
Expand Down

0 comments on commit 1873d4f

Please sign in to comment.