Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Refactor state into refs and tree.
Browse files Browse the repository at this point in the history
Also try to strengthen abstractions around prefixes and atomic commits.

Signed-off-by: Silas Davis <[email protected]>
  • Loading branch information
Silas Davis committed Sep 14, 2018
1 parent 4afe839 commit eb5dd62
Show file tree
Hide file tree
Showing 32 changed files with 2,319 additions and 243 deletions.
4 changes: 2 additions & 2 deletions deploy/def/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *Client) Dial(chainAddress, keysClientAddress string) error {
logrus.Info("Using mempool signing since no keyClient set, pass --keys to sign locally or elsewhere")
c.MempoolSigning = true
} else {
logrus.Info("Using keys server at: %s", keysClientAddress)
logrus.Infof("Using keys server at: %s", keysClientAddress)
c.keyClient, err = keys.NewRemoteKeyClient(keysClientAddress, logging.NewNoopLogger())
}

Expand Down Expand Up @@ -227,7 +227,7 @@ func (c *Client) UpdateAccount(arg *GovArg) (*payload.GovTx, error) {
if c.keyClient != nil {
publicKey, err := c.keyClient.PublicKey(*update.Address)
if err != nil {
logrus.Info("Could not retrieve public key for %v from keys server", *update.Address)
logrus.Infof("Could not retrieve public key for %v from keys server", *update.Address)
} else {
update.PublicKey = &publicKey
}
Expand Down
2 changes: 1 addition & 1 deletion execution/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ func (vm *VM) call(callState *state.Cache, caller acm.Account, callee *acm.Mutab

case GASPRICE_DEPRECATED: // 0x3A
stack.Push(Zero256)
vm.Debugf(" => %X (GASPRICE IS DEPRECATED)\n")
vm.Debugf(" => %X (GASPRICE IS DEPRECATED)\n", Zero256)

case EXTCODESIZE: // 0x3B
addr := stack.Pop()
Expand Down
8 changes: 4 additions & 4 deletions execution/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ func TestTxSequence(t *testing.T) {
func TestNameTxs(t *testing.T) {
st, err := MakeGenesisState(dbm.NewMemDB(), testGenesisDoc)
require.NoError(t, err)
st.writeState.save()
st.writeState.commit()

names.MinNameRegistrationPeriod = 5
exe := makeExecutor(st)
Expand Down Expand Up @@ -1196,7 +1196,7 @@ func TestMerklePanic(t *testing.T) {
acc0 := getAccount(st, privAccounts[0].Address())
acc1 := getAccount(st, privAccounts[1].Address())

st.writeState.save()
st.writeState.commit()
// SendTx.
{
tx := &payload.SendTx{
Expand Down Expand Up @@ -1238,7 +1238,7 @@ func TestMerklePanic(t *testing.T) {
err := makeExecutor(stateCallTx).signExecuteCommit(tx, privAccounts[0])
require.NoError(t, err)
}
st.writeState.save()
st.writeState.commit()
trygetacc0 := getAccount(st, privAccounts[0].Address())
fmt.Println(trygetacc0.Address())
}
Expand Down Expand Up @@ -1499,7 +1499,7 @@ func makeGenesisState(numAccounts int, randBalance bool, minBalance uint64, numV
if err != nil {
panic(fmt.Errorf("could not make genesis state: %v", err))
}
s0.writeState.save()
s0.writeState.commit()
return s0, privAccounts
}

Expand Down
Loading

0 comments on commit eb5dd62

Please sign in to comment.