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

fixed issues: RPC DERO.GetTransactions & RPC transfer with integrated addresses; show raw tx when registration fails #85

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions blockchain/storetopo.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ func (chain *Blockchain) Find_Blocks_Height_Range(startheight, stopheight int64)
}
_, topos_end := chain.Store.Topo_store.binarySearchHeight(stopheight)

if topos_start == nil || topos_end == nil {
return
}

lowest := topos_start[0]
for _, t := range topos_start {
if t < lowest {
Expand Down
37 changes: 19 additions & 18 deletions cmd/dero-wallet-cli/easymenu_post_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@

package main

import "io"
import "os"
import "time"
import "fmt"
import "errors"
import "runtime"
import "strings"

import "path/filepath"
import "encoding/json"

import "github.com/chzyer/readline"

import "github.com/deroproject/derohe/rpc"
import "github.com/deroproject/derohe/globals"
import (
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
"strings"
"time"

"github.com/chzyer/readline"
"github.com/deroproject/derohe/cryptography/crypto"
"github.com/deroproject/derohe/globals"
"github.com/deroproject/derohe/rpc"
"github.com/deroproject/derohe/transaction"
)

//import "github.com/deroproject/derohe/address"

import "github.com/deroproject/derohe/cryptography/crypto"
import "github.com/deroproject/derohe/transaction"

// handle menu if a wallet is currently opened
func display_easymenu_post_open_command(l *readline.Instance) {
w := l.Stderr()
Expand Down Expand Up @@ -162,6 +162,7 @@ func handle_easymenu_post_open_command(l *readline.Instance, line string) (proce
err := wallet.SendTransaction(reg_tx)
if err != nil {
fmt.Fprintf(l.Stderr(), "sending registration tx err %s\n", err)
fmt.Fprintf(l.Stderr(), "You can register your wallet by sending this RAW tx data to the daemon (DERO.SendRawTransaction):\n%s\n", hex.EncodeToString(reg_tx.Serialize()))
} else {
fmt.Fprintf(l.Stderr(), "registration tx dispatched successfully\n")
}
Expand Down
21 changes: 11 additions & 10 deletions walletapi/wallet_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,35 @@

package walletapi

import "fmt"
import (
"encoding/hex"
"fmt"

"github.com/deroproject/derohe/config"
"github.com/deroproject/derohe/cryptography/bn256"
"github.com/deroproject/derohe/cryptography/crypto"
"github.com/deroproject/derohe/rpc"
"github.com/deroproject/derohe/transaction"
)

//import "sort"
//import "math/rand"
//import cryptorand "crypto/rand"

//import "encoding/binary"
import "encoding/hex"

//import "encoding/json"

//import "github.com/vmihailenco/msgpack"

import "github.com/deroproject/derohe/config"
import "github.com/deroproject/derohe/cryptography/crypto"

//import "github.com/deroproject/derohe/crypto/ringct"
import "github.com/deroproject/derohe/transaction"

//import "github.com/deroproject/derohe/globals"
import "github.com/deroproject/derohe/rpc"

//import "github.com/deroproject/derohe/ddn"

//import "github.com/deroproject/derohe/structures"
//import "github.com/deroproject/derohe/blockchain/inputmaturity"
import "github.com/deroproject/derohe/cryptography/bn256"

/*
func (w *Wallet_Memory) Transfer_Simplified(addr string, value uint64, data []byte, scdata rpc.Arguments) (tx *transaction.Transaction, err error) {
Expand Down Expand Up @@ -302,10 +304,9 @@ func (w *Wallet_Memory) TransferPayload0(transfers []rpc.Transfer, ringsize uint
} else {
fmt.Printf("integrtated address, but don't know how to process\n")
err = fmt.Errorf("integrated address used, but don't know how to process %+v", addr.Arguments)
return
}
}

return
}

var dest_e *crypto.ElGamal
Expand Down