diff --git a/container/container_contract.go b/container/container_contract.go index e8e6bb1..f45c1c9 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -343,6 +343,11 @@ type DelInfo struct { Epoch int } +type delInfo struct { + Owner []byte + Epoch []byte +} + // DeletionInfo method returns container deletion info. // If the container had never existed, NotFoundError is throwed. // It can be used to check whether non-existing container was indeed deleted @@ -354,7 +359,12 @@ func DeletionInfo(containerID []byte) DelInfo { if data == nil { panic(NotFoundError) } - return std.Deserialize(data).(DelInfo) + + d := std.Deserialize(data).(delInfo) + return DelInfo{ + Owner: d.Owner, + Epoch: common.FromFixedWidth64(d.Epoch), + } } // Get method returns a structure that contains a stable marshaled Container structure, @@ -631,9 +641,9 @@ func removeContainer(ctx storage.Context, id []byte, owner []byte) { graveKey := append([]byte{graveKeyPrefix}, id...) netmapContractAddr := storage.Get(ctx, netmapContractKey).(interop.Hash160) epoch := contract.Call(netmapContractAddr, "epoch", contract.ReadOnly).(int) - common.SetSerialized(ctx, graveKey, DelInfo{ + common.SetSerialized(ctx, graveKey, delInfo{ Owner: owner, - Epoch: epoch, + Epoch: common.ToFixedWidth64(epoch), }) } diff --git a/tests/container_test.go b/tests/container_test.go index 2f5d9d5..0508c3c 100644 --- a/tests/container_test.go +++ b/tests/container_test.go @@ -283,8 +283,6 @@ func TestContainerDelete(t *testing.T) { }) t.Run("gas costs are the same for different epochs", func(t *testing.T) { - t.Skip() - _, cnt2 := addContainer(t, c, cBal) args := []interface{}{cnt2.id[:], cnt2.sig, cnt2.pub, cnt2.token}