-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: add genesis type #443
Conversation
assert.Equal(t, base64.StdEncoding.EncodeToString(json.Encode(genesis)), base64.StdEncoding.EncodeToString([]byte(genesisStr))) | ||
} | ||
|
||
func TestGenesis_Balances(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test copied from go-algorand
types/genesis_test.go
Outdated
func TestEncodeDecodeGenesis(t *testing.T) { | ||
genesisStr := "{\n \"alloc\": [\n {\n \"addr\": \"7777777777777777777777777777777777777777777777777774MSJUVU\",\n \"comment\": \"RewardsPool\",\n \"state\": {\n \"algo\": 125000000000000,\n \"onl\": 2\n }\n },\n {\n \"addr\": \"LX6VRFCL4723LRO3VEX5XNOXHFXFQKATKDLDBT5HNT5DFDC3SQG4EI2LSI\",\n \"comment\": \"Wallet1\",\n \"state\": {\n \"algo\": 1000000000000000,\n \"onl\": 1,\n \"sel\": \"XGIljovdG8IjSQJRcvc/vi6UXXTIddUgjZACWZPW23M=\",\n \"vote\": \"zccp6OB5EOh21WMV7A7iVg+CitiZeOao+VYbIkNdPgM=\",\n \"voteKD\": 10000,\n \"voteLst\": 3000000\n }\n }\n ],\n \"fees\": \"A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE\",\n \"id\": \"v1\",\n \"network\": \"sandnet\",\n \"proto\": \"future\",\n \"rwd\": \"7777777777777777777777777777777777777777777777777774MSJUVU\"\n}" | ||
var genesis Genesis | ||
json.Decode([]byte(genesisStr), &genesis) | ||
assert.Equal(t, base64.StdEncoding.EncodeToString(json.Encode(genesis)), base64.StdEncoding.EncodeToString([]byte(genesisStr))) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you generate a hash on algod and confirm that you get the same hash here?
|
||
// Timestamp for the genesis block | ||
Timestamp int64 `codec:"timestamp"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need these too for parity with go-algorand.
Comment string codec:"comment"`
DevMode bool `codec:"devmode"`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
adding genesis type