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

[move] Add large enum test #19075

Merged
merged 4 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
new tests
  • Loading branch information
tnowacki committed Aug 22, 2024
commit 943e9ad2fbac783c1fcdac2eeb8d2f918e40495b
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

// tests error after serializing a large enum return value

//# init --addresses test=0x0 --accounts A

//# publish

module test::m {

public enum X1 {
Big(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8),
}

public enum X2 {
V1(X1, X1, X1),
V2(X1, X1, X1),
V3(X1, X1, X1),
}

public enum X3 {
X2(X2, X2, X2),
U64(u64),
}

entry fun x1(): X1 {
X1::Big(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
}

entry fun x3(): X3 {
X3::U64(0)
}

}


//# programmable --sender A
//> test::m::x1()
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// tests error after serializing a large enum return value

//# init --edition 2024.alpha

//# publish

module 0x42::m {

public enum X1 {
Big(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8),
}

public enum X2 {
V1(X1, X1, X1),
V2(X1, X1, X1),
V3(X1, X1, X1),
}

public enum X3 {
X2(X2, X2, X2),
U64(u64),
}

entry fun x1(): X1 {
X1::Big(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
}

entry fun x3(): X3 {
X3::U64(0)
}


}


//# run 0x42::m::x3