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

Checking the metadata compatibility of a module when it's upgrading. #2218

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 2 tasks

task 0 'publish'. lines 1-40:
status EXECUTED

task 1 'publish'. lines 42-82:
status ABORTED with code 13004 in 0000000000000000000000000000000000000000000000000000000000000002::move_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
0x11::TestModule1::f1 -> [0, 1];
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
// error code 13004: INVALID_DATA_STRUCT_FUNC_INCOMPATIBLE_MODIFY
0x11::TestModule1::f1 -> [0];
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 2 tasks

task 0 'publish'. lines 1-40:
status EXECUTED

task 1 'publish'. lines 42-82:
status ABORTED with code 13003 in 0000000000000000000000000000000000000000000000000000000000000002::move_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
0x11::TestModule1::f1 -> [0, 1];
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
// error code 13003: INVALID_DATA_STRUCT_FUNC_INCOMPATIBLE_REMOVE
// 0x11::TestModule1::f1 -> [0, 1];
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 2 tasks

task 0 'publish'. lines 1-37:
status EXECUTED

task 1 'publish'. lines 39-79:
status ABORTED with code 13008 in 0000000000000000000000000000000000000000000000000000000000000002::move_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
// error code 13008: INVALID_DATA_STRUCT_FUNC_INCOMPATIBLE_WITH_EXISTS
0x11::TestModule1::f1 -> [0, 1];
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 2 tasks

task 0 'publish'. lines 1-14:
status EXECUTED

task 1 'publish'. lines 16-55:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
}
}
}

//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x1.vector;
struct S0 has copy,drop { x: u64 }

metadata {
data_struct {
0x11::TestModule1::S0 -> true;
}
data_struct_func {
0x11::TestModule1::f1 -> [0, 1];
}
}

public new(): Self.S0 {
label b0:
return S0{ x: 123 };
}

public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) {
label b0:
_ = move(arg1);
_ = move(arg2);
return;
}

public f2() {
let s0: Self.S0;
let s1: vector<u8>;
let s2: string.String;

label b0:
s0 = Self.new();
s1 = vector.empty<u8>();
s2 = string.utf8(move(s1));
Self.f1<Self.S0, string.String>(move(s0), move(s2));
return;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 2 tasks

task 0 'publish'. lines 1-40:
status EXECUTED

task 1 'publish'. lines 42-81:
status EXECUTED
Loading
Loading