github.com/turingchain2020/turingchain@v1.1.21/account/genesis_test.go (about) 1 // Copyright Turing Corp. 2018 All Rights Reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package account 6 7 import ( 8 "testing" 9 //"fmt" 10 "github.com/turingchain2020/turingchain/common/address" 11 "github.com/stretchr/testify/require" 12 ) 13 14 func TestGenesisInit(t *testing.T) { 15 accCoin, _ := GenerAccDb() 16 accCoin.GenerAccData() 17 _, err := accCoin.GenesisInit(addr1, 100*1e8) 18 require.NoError(t, err) 19 //t.Logf("GenesisInit is %v", recp) 20 t.Logf("GenesisInit [%d]", 21 accCoin.LoadAccount(addr1).Balance) 22 } 23 24 func TestGenesisInitExec(t *testing.T) { 25 accCoin, _ := GenerAccDb() 26 execaddr := address.ExecAddress("coins") 27 _, err := accCoin.GenesisInitExec(addr1, 10*1e8, execaddr) 28 require.NoError(t, err) 29 //t.Logf("GenesisInitExec Receipt is %v", Receipt) 30 t.Logf("GenesisInitExec [%d]___[%d]", 31 accCoin.LoadExecAccount(addr1, execaddr).Balance, 32 accCoin.LoadAccount(execaddr).Balance) 33 require.Equal(t, int64(10*1e8), accCoin.LoadExecAccount(addr1, execaddr).Balance) 34 require.Equal(t, int64(10*1e8), accCoin.LoadAccount(execaddr).Balance) 35 }