File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change
1
+ package gnolang
2
+
3
+ import (
4
+ "math/big"
5
+ "testing"
6
+
7
+ "github.com/gnolang/gno/tm2/pkg/amino"
8
+ )
9
+
10
+ // This test exposes a panics that occurs when BigintValue is embedded
11
+ // in an other struct.
12
+ func TestAminoMustMarshalJSONPanics (t * testing.T ) {
13
+ bi := BigintValue {V : big .NewInt (20 )}
14
+ b := amino .MustMarshalJSON (bi ) // works well
15
+ println (string (b ))
16
+
17
+ pv := PackageValue {
18
+ Block : bi ,
19
+ }
20
+ b = amino .MustMarshalJSON (pv ) // panics
21
+ println (string (b ))
22
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ func (a Address) String() string {
6
6
return string(a)
7
7
}
8
8
9
- const RawAddressSize = int(20)
9
+ const RawAddressSize = 20
10
10
11
11
type RawAddress [RawAddressSize]byte
You can’t perform that action at this time.
0 commit comments