-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from xssnick/dev-v19
v1.10.0
- Loading branch information
Showing
29 changed files
with
641 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package tlb | ||
|
||
import ( | ||
"github.com/xssnick/tonutils-go/tvm/cell" | ||
"testing" | ||
) | ||
|
||
func TestStateInit_CalcAddress(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
stateInit StateInit | ||
workchain int | ||
want string | ||
}{ | ||
{ | ||
name: "Base", | ||
stateInit: StateInit{ | ||
Code: cell.BeginCell().MustStoreUInt(0, 8).EndCell(), | ||
Data: cell.BeginCell().MustStoreUInt(0, 8).EndCell(), | ||
}, | ||
workchain: 0, | ||
want: "EQBPQF6r6-pUObVWu6RO05YwoHQRnjM95tRLAL_s2A6n0pvq", | ||
}, | ||
{ | ||
name: "Empty", | ||
stateInit: StateInit{}, | ||
workchain: 0, | ||
want: "EQA_B407fiLIlE5VYZCaI2rki0in6kLyjdhhwitvZNfpe7eY", | ||
}, | ||
{ | ||
name: "Master", | ||
stateInit: StateInit{ | ||
Code: cell.BeginCell().MustStoreUInt(123, 8).EndCell(), | ||
Data: cell.BeginCell().MustStoreUInt(456, 16).EndCell(), | ||
}, | ||
workchain: -1, | ||
want: "Ef_jHHi5wLtyTaS56iIEPUc9mJuoD2keQPxZX87rl2FcVDZ1", | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got := tt.stateInit.CalcAddress(tt.workchain) | ||
if got.String() != tt.want { | ||
t.Errorf("StateInit.CalcAddress() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.