// If the tx is invalid, an error will be returned. // Unlike ExecBlock(), state will not be altered. func(exe *executor) Execute(txEnv *txs.Envelope) (txe *exec.TxExecution, err error) { ...... // Verify transaction signature against inputs err = txEnv.Verify(exe.params.ChainID) if err != nil { logger.InfoMsg("Transaction Verify failed", structure.ErrorKey, err) returnnil, err }
if txExecutor, ok := exe.contexts[txEnv.Tx.Type()]; ok { // Establish new TxExecution txe := exe.block.Tx(txEnv) deferfunc() { if r := recover(); r != nil { err = fmt.Errorf("recovered from panic in executor.Execute(%s): %v\n%s", txEnv.String(), r, debug.Stack()) } }()
func(ctx *CallContext) Execute(txe *exec.TxExecution, p payload.Payload) error { var ok bool ctx.tx, ok = p.(*payload.CallTx) if !ok { return fmt.Errorf("payload must be CallTx, but is: %v", p) } ctx.txe = txe inAcc, outAcc, err := ctx.Precheck() if err != nil { return err } // That the fee less than the input amount is checked by Precheck to be greater than or equal to fee value := ctx.tx.Input.Amount - ctx.tx.Fee
/** * acmstate.ReaderWriter for managing Secure Native authorizations. * @dev This interface describes the functions exposed by the native permissions layer in burrow. * @dev These functions can be accessed as if this contract were deployed at a special address (0x0A758FEB535243577C1A79AE55BED8CA03E226EC). * @dev This special address is defined as the last 20 bytes of the sha3 hash of the the contract name. * @dev To instantiate the contract use: * @dev Permissions permissions = Permissions(address(uint256(keccak256("Permissions")))); */ interface Permissions { /** * @notice Adds a role to an account * @param Account account address * @param Role role name * @return result whether role was added */ functionaddRole(address _account, string memory _role) public view returns (bool _result);
/** * @notice Removes a role from an account * @param Account account address * @param Role role name * @return result whether role was removed */ functionremoveRole(address _account, string memory _role) public view returns (bool _result);
/** * @notice Indicates whether an account has a role * @param Account account address * @param Role role name * @return result whether account has role */ functionhasRole(address _account, string memory _role) public view returns (bool _result);
/** * @notice Sets the permission flags for an account. Makes them explicitly set (on or off). * @param Account account address * @param Permission the base permissions flags to set for the account * @param Set whether to set or unset the permissions flags at the account level * @return The permission flag that was set as uint64 */ functionsetBase(address _account, uint64 _permission, bool _set) public view returns (uint64 _result);
/** * @notice Unsets the permissions flags for an account. Causes permissions being unset to fall through to global permissions. * @param Account account address * @param Permission the permissions flags to unset for the account * @return The permission flag that was unset as uint64 */ functionunsetBase(address _account, uint64 _permission) public view returns (uint64 _result);
/** * @notice Indicates whether an account has a subset of permissions set * @param Account account address * @param Permission the permissions flags (mask) to check whether enabled against base permissions for the account * @return result whether account has the passed permissions flags set */ functionhasBase(address _account, uint64 _permission) public view returns (bool _result);
/** * @notice Sets the global (default) permissions flags for the entire chain * @param Permission the permissions flags to set * @param Set whether to set (or unset) the permissions flags * @return The permission flag that was set as uint64 */ functionsetGlobal(uint64 _permission, bool _set) public view returns (uint64 _result); }
./burrow dump , Dump chain state to backup
1 2 3 4 5 6 7 8
➜ script ./burrow dump local backup_dump Sourcing config from first of: defaults Sourcing config from defaults Sourcing config from first of: genesis file at genesis.json Sourcing config from genesis file at genesis.json {"log_channel":"Info","message":"Dumping accounts"} {"log_channel":"Info","message":"Dumping names"} {"log_channel":"Info","message":"Dumping events"}