Skip to content

Commit

Permalink
Fix: smart rollup address validation
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Feb 7, 2024
1 parent 18a5847 commit 0be6289
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/bcd/ast/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func TestAddressValidator(t *testing.T) {
name: "test 5",
value: "0x6e4943f7a23ab9cbe56f48ff72f6c27e8956762400",
wantErr: true,
}, {
name: "test 6",
value: "sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg",
wantErr: false,
},
}
for _, tt := range tests {
Expand Down
4 changes: 3 additions & 1 deletion internal/bcd/literal.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func IsContractLazy(str string) bool {

// IsAddressLazy -
func IsAddressLazy(address string) bool {
return (len(address) == 36 && (strings.HasPrefix(address, "KT") || strings.HasPrefix(address, "tz"))) ||
return (len(address) == 36 && (strings.HasPrefix(address, "KT") ||
strings.HasPrefix(address, "tz") ||
strings.HasPrefix(address, "sr1"))) ||
(len(address) == 37 && strings.HasPrefix(address, "txr"))
}

Expand Down

0 comments on commit 0be6289

Please sign in to comment.