Skip to content
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

Break the unsigned transaction data out of the transaction #1640

Merged
merged 13 commits into from
Oct 11, 2024
4 changes: 2 additions & 2 deletions api/jsonrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ func (cli *JSONRPCClient) GenerateTransactionManual(

// Build transaction
actionCodec, authCodec := parser.ActionCodec(), parser.AuthCodec()
tx := chain.NewTx(base, actions)
tx, err := tx.Sign(authFactory, actionCodec, authCodec)
unsignedTx := chain.NewTxData(base, actions)
tx, err := unsignedTx.Sign(authFactory, actionCodec, authCodec)
if err != nil {
return nil, nil, fmt.Errorf("%w: failed to sign transaction", err)
}
Expand Down
2 changes: 1 addition & 1 deletion api/jsonrpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (j *JSONRPCServer) SubmitTx(
if !rtx.Empty() {
return errTransactionExtraBytes
}
if err := tx.Verify(ctx); err != nil {
if err := tx.VerifyAuth(ctx); err != nil {
return err
}
txID := tx.ID()
Expand Down
2 changes: 1 addition & 1 deletion api/ws/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (w *WebSocketServer) MessageCallback() pubsub.Callback {

// Verify tx
if w.vm.GetVerifyAuth() {
if err := tx.Verify(ctx); err != nil {
if err := tx.VerifyAuth(ctx); err != nil {
w.logger.Error("failed to verify sig",
zap.Error(err),
)
Expand Down
Loading
Loading