Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sbillig committed Jun 1, 2022
1 parent 27ebd97 commit 411d4b8
Show file tree
Hide file tree
Showing 184 changed files with 2,116 additions and 1,183 deletions.
117 changes: 82 additions & 35 deletions crates/analyzer/tests/snapshots/analysis__abi_encoding_stress.snap
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ note:
note:
┌─ abi_encoding_stress.fe:27:5
27 │ ╭ pub fn set_my_addrs(self, my_addrs: Array<address, 5>) {
27 │ ╭ pub fn set_my_addrs(mut self, my_addrs: Array<address, 5>) {
28 │ │ self.my_addrs = my_addrs
29 │ │ }
│ ╰─────^ attributes hash: 8893819222299525150
│ ╰─────^ attributes hash: 2261211863999912498
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 535..539,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "my_addrs",
typ: Ok(
Expand Down Expand Up @@ -101,11 +105,14 @@ note:
31 │ ╭ pub fn get_my_addrs(self) -> Array<address, 5> {
32 │ │ return self.my_addrs.to_mem()
33 │ │ }
│ ╰─────^ attributes hash: 1736881624347502724
│ ╰─────^ attributes hash: 1242159413180920033
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 636..640,
},
),
ctx_decl: None,
params: [],
Expand Down Expand Up @@ -140,18 +147,22 @@ note:
note:
┌─ abi_encoding_stress.fe:35:5
35 │ ╭ pub fn set_my_u128(self, my_u128: u128) {
35 │ ╭ pub fn set_my_u128(mut self, my_u128: u128) {
36 │ │ self.my_u128 = my_u128
37 │ │ }
│ ╰─────^ attributes hash: 15199964699853061770
│ ╰─────^ attributes hash: 10686864831516926105
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 737..741,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "my_u128",
typ: Ok(
Expand Down Expand Up @@ -190,11 +201,14 @@ note:
39 │ ╭ pub fn get_my_u128(self) -> u128 {
40 │ │ return self.my_u128
41 │ │ }
│ ╰─────^ attributes hash: 15343208064821852867
│ ╰─────^ attributes hash: 13239177426284803553
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 821..825,
},
),
ctx_decl: None,
params: [],
Expand Down Expand Up @@ -222,18 +236,22 @@ note:
note:
┌─ abi_encoding_stress.fe:43:5
43 │ ╭ pub fn set_my_string(self, my_string: String<10>) {
43 │ ╭ pub fn set_my_string(mut self, my_string: String<10>) {
44 │ │ self.my_string = my_string
45 │ │ }
│ ╰─────^ attributes hash: 241116312146617781
│ ╰─────^ attributes hash: 7050396491214636923
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 901..905,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "my_string",
typ: Ok(
Expand Down Expand Up @@ -272,11 +290,14 @@ note:
47 │ ╭ pub fn get_my_string(self) -> String<10> {
48 │ │ return self.my_string.to_mem()
49 │ │ }
│ ╰─────^ attributes hash: 1556448784000816371
│ ╰─────^ attributes hash: 6543955680763677008
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 999..1003,
},
),
ctx_decl: None,
params: [],
Expand Down Expand Up @@ -310,18 +331,22 @@ note:
note:
┌─ abi_encoding_stress.fe:51:5
51 │ ╭ pub fn set_my_u16s(self, my_u16s: Array<u16, 255>) {
51 │ ╭ pub fn set_my_u16s(mut self, my_u16s: Array<u16, 255>) {
52 │ │ self.my_u16s = my_u16s
53 │ │ }
│ ╰─────^ attributes hash: 15015381430419725173
│ ╰─────^ attributes hash: 4346788423205731808
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 1094..1098,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "my_u16s",
typ: Ok(
Expand Down Expand Up @@ -363,11 +388,14 @@ note:
55 │ ╭ pub fn get_my_u16s(self) -> Array<u16, 255> {
56 │ │ return self.my_u16s.to_mem()
57 │ │ }
│ ╰─────^ attributes hash: 14119474618304681318
│ ╰─────^ attributes hash: 11956605043509286213
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 1189..1193,
},
),
ctx_decl: None,
params: [],
Expand Down Expand Up @@ -404,18 +432,22 @@ note:
note:
┌─ abi_encoding_stress.fe:59:5
59 │ ╭ pub fn set_my_bool(self, my_bool: bool) {
59 │ ╭ pub fn set_my_bool(mut self, my_bool: bool) {
60 │ │ self.my_bool = my_bool
61 │ │ }
│ ╰─────^ attributes hash: 3845928701529339179
│ ╰─────^ attributes hash: 1055917414416595358
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 1287..1291,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "my_bool",
typ: Ok(
Expand Down Expand Up @@ -452,11 +484,14 @@ note:
63 │ ╭ pub fn get_my_bool(self) -> bool {
64 │ │ return self.my_bool
65 │ │ }
│ ╰─────^ attributes hash: 2163156009319630199
│ ╰─────^ attributes hash: 9113221655060069026
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 1371..1375,
},
),
ctx_decl: None,
params: [],
Expand All @@ -482,18 +517,22 @@ note:
note:
┌─ abi_encoding_stress.fe:67:5
67 │ ╭ pub fn set_my_bytes(self, my_bytes: Array<u8, 100>) {
67 │ ╭ pub fn set_my_bytes(mut self, my_bytes: Array<u8, 100>) {
68 │ │ self.my_bytes = my_bytes
69 │ │ }
│ ╰─────^ attributes hash: 11573101353594183790
│ ╰─────^ attributes hash: 14575135303485954620
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 1450..1454,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "my_bytes",
typ: Ok(
Expand Down Expand Up @@ -535,11 +574,14 @@ note:
71 │ ╭ pub fn get_my_bytes(self) -> Array<u8, 100> {
72 │ │ return self.my_bytes.to_mem()
73 │ │ }
│ ╰─────^ attributes hash: 157798734366762321
│ ╰─────^ attributes hash: 2825026861954100839
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 1548..1552,
},
),
ctx_decl: None,
params: [],
Expand Down Expand Up @@ -627,20 +669,21 @@ note:
note:
┌─ abi_encoding_stress.fe:79:5
79 │ ╭ pub fn mod_my_struct(my_struct: MyStruct) -> MyStruct {
79 │ ╭ pub fn mod_my_struct(mut my_struct: MyStruct) -> MyStruct {
80 │ │ my_struct.my_num = 12341234
81 │ │ my_struct.my_num2 = u8(42)
82 │ │ my_struct.my_bool = false
83 │ │ my_struct.my_addr = address(9999)
84 │ │ return my_struct
85 │ │ }
│ ╰─────^ attributes hash: 11747697140833990696
│ ╰─────^ attributes hash: 13200187284784553811
= FunctionSignature {
self_decl: None,
ctx_decl: None,
params: [
FunctionParam {
is_mut: true,
label: None,
name: "my_struct",
typ: Ok(
Expand Down Expand Up @@ -724,20 +767,24 @@ note:
note:
┌─ abi_encoding_stress.fe:87:5
87 │ ╭ pub fn emit_my_event(self, ctx: Context) {
87 │ ╭ pub fn emit_my_event(self, mut ctx: Context) {
88 │ │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
89 │ │ }
│ ╰─────^ attributes hash: 1731341862738941170
│ ╰─────^ attributes hash: 7205084328787069281
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 2029..2033,
},
),
ctx_decl: Some(
Mutable,
),
params: [
FunctionParam {
is_mut: true,
label: None,
name: "ctx",
typ: Ok(
Expand Down
19 changes: 14 additions & 5 deletions crates/analyzer/tests/snapshots/analysis__address_bytes10_map.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ note:
4 │ ╭ pub fn read_bar(self, key: address) -> Array<u8, 10> {
5 │ │ return self.bar[key].to_mem()
6 │ │ }
│ ╰─────^ attributes hash: 7365261960972751402
│ ╰─────^ attributes hash: 10562697749306342509
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: Ref,
span: 73..77,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "key",
typ: Ok(
Expand Down Expand Up @@ -74,18 +78,22 @@ note:
note:
┌─ address_bytes10_map.fe:8:5
8 │ ╭ pub fn write_bar(self, key: address, value: Array<u8, 10>) {
8 │ ╭ pub fn write_bar(mut self, key: address, value: Array<u8, 10>) {
9 │ │ self.bar[key] = value
10 │ │ }
│ ╰─────^ attributes hash: 10331226497424577374
│ ╰─────^ attributes hash: 13716785056256225687
= FunctionSignature {
self_decl: Some(
Mutable,
SelfDecl {
kind: MutRef,
span: 182..186,
},
),
ctx_decl: None,
params: [
FunctionParam {
is_mut: false,
label: None,
name: "key",
typ: Ok(
Expand All @@ -95,6 +103,7 @@ note:
),
},
FunctionParam {
is_mut: false,
label: None,
name: "value",
typ: Ok(
Expand Down
Loading

0 comments on commit 411d4b8

Please sign in to comment.