Skip to content

Commit

Permalink
Add init verification (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
WGB5445 authored Sep 13, 2023
1 parent 2417e23 commit 0c6ea74
Show file tree
Hide file tree
Showing 4 changed files with 275 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
processed 13 tasks

task 1 'publish'. lines 3-9:
Error: error: module init function should not have a primitive type other than a signer
┌─ /tmp/tempfile:5:5
5 │ ╭ fun init( _: u8 ){
6 │ │ }
│ ╰─────^



task 2 'publish'. lines 11-17:
Error: error: module init function should not have a primitive type other than a signer
┌─ /tmp/tempfile:13:5
13 │ ╭ fun init( _: u16 ){
14 │ │ }
│ ╰─────^



task 3 'publish'. lines 19-25:
Error: error: module init function should not have a primitive type other than a signer
┌─ /tmp/tempfile:21:5
21 │ ╭ fun init( _: u32 ){
22 │ │ }
│ ╰─────^



task 4 'publish'. lines 27-33:
Error: error: module init function should not have a primitive type other than a signer
┌─ /tmp/tempfile:29:5
29 │ ╭ fun init( _: u64 ){
30 │ │ }
│ ╰─────^



task 5 'publish'. lines 35-41:
Error: error: module init function should not have a primitive type other than a signer
┌─ /tmp/tempfile:37:5
37 │ ╭ fun init( _: u128 ){
38 │ │ }
│ ╰─────^



task 6 'publish'. lines 43-49:
Error: error: module init function should not have a primitive type other than a signer
┌─ /tmp/tempfile:45:5
45 │ ╭ fun init( _: u256 ){
46 │ │ }
│ ╰─────^



task 7 'publish'. lines 52-62:
Error: error: module init function only should have two parameter types with signer or storageContext
┌─ /tmp/tempfile:57:5
57 │ ╭ fun init( _foo: Foo ){
58 │ │ }
│ ╰─────^



task 8 'publish'. lines 64-71:
Error: error: module init function only should have two parameter types with signer or storageContext
┌─ /tmp/tempfile:67:5
67 │ ╭ fun init( _: object_id::ObjectID ){
68 │ │ }
│ ╰─────^



task 9 'publish'. lines 73-80:
Error: error: module init function only should have two parameter types with signer or storageContext
┌─ /tmp/tempfile:76:5
76 │ ╭ fun init( _: string::String ){
77 │ │ }
│ ╰─────^



task 10 'publish'. lines 82-89:
Error: error: module init function only should have two parameter types with signer or storageContext
┌─ /tmp/tempfile:85:5
85 │ ╭ fun init( _: string::String ){
86 │ │ }
│ ╰─────^



task 11 'publish'. lines 91-98:
Error: error: module init function only should have two parameter types with signer or storageContext
┌─ /tmp/tempfile:94:5
94 │ ╭ fun init( _: ascii::String ){
95 │ │ }
│ ╰─────^



task 12 'publish'. lines 100-107:
Error: error: module init function should not have a reference primitive type other than a signer
┌─ /tmp/tempfile:103:5
103 │ ╭ fun init( _ : & storage_context::StorageContext){
104 │ │ }
│ ╰─────^


Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
//# init --addresses creator=0x42

//# publish
module creator::test {

fun init( _: u8 ){

}
}

//# publish
module creator::test {

fun init( _: u16 ){

}
}

//# publish
module creator::test {

fun init( _: u32 ){

}
}

//# publish
module creator::test {

fun init( _: u64 ){

}
}

//# publish
module creator::test {

fun init( _: u128 ){

}
}

//# publish
module creator::test {

fun init( _: u256 ){

}
}


//# publish
module creator::test {

struct Foo has copy, drop {
x: u64,
}

fun init( _foo: Foo ){

}
}

//# publish
module creator::test {
use moveos_std::object_id;

fun init( _: object_id::ObjectID ){

}
}

//# publish
module creator::test {
use std::string;

fun init( _: string::String ){

}
}

//# publish
module creator::test {
use std::string;

fun init( _: string::String ){

}
}

//# publish
module creator::test {
use std::ascii;

fun init( _: ascii::String ){

}
}

//# publish
module creator::test {
use moveos_std::storage_context;

fun init( _ : & storage_context::StorageContext){

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
processed 5 tasks

task 1 'publish'. lines 3-9:
status EXECUTED

task 2 'publish'. lines 11-18:
status EXECUTED

task 3 'publish'. lines 20-26:
status EXECUTED

task 4 'publish'. lines 28-34:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//# init --addresses creator=0x42

//# publish
module creator::test {

fun init( _ : & signer){

}
}

//# publish
module creator::test_mut_ref_storage_context {
use moveos_std::storage_context;

fun init( _ : &mut storage_context::StorageContext){

}
}

//# publish
module creator::test_signer {

fun init( _ : signer){

}
}

//# publish
module creator::test_ref_signer {

fun init( _ : & signer){

}
}

0 comments on commit 0c6ea74

Please sign in to comment.