upstream sync
This commit is contained in:
@@ -29,7 +29,7 @@ func NewService(blockchainConfig config.Blockchain) Service {
|
||||
type Service interface {
|
||||
CreateContract(ctx context.Context, contractID [32]byte) error
|
||||
AddIOTData(ctx context.Context, contractID [32]byte, deviceID [32]byte, timestamp *big.Int, data []byte) error
|
||||
RegisterNewDeviceIDs(ctx context.Context, contractID [32]byte, deviceIDs [][32]byte) error
|
||||
RegisterNewDeviceID(ctx context.Context, contractID [32]byte, deviceID [32]byte) error
|
||||
}
|
||||
|
||||
func (s *service) signerFunc(address common.Address, txn *types.Transaction) (*types.Transaction, error) {
|
||||
@@ -100,13 +100,13 @@ func (s *service) CreateContract(ctx context.Context, contractID [32]byte) error
|
||||
}
|
||||
|
||||
// map devices with blockchain contract
|
||||
func (s *service) RegisterNewDeviceIDs(ctx context.Context, contractID [32]byte, deviceIDs [][32]byte) error {
|
||||
func (s *service) RegisterNewDeviceID(ctx context.Context, contractID [32]byte, deviceID [32]byte) error {
|
||||
conn, contract, err := s.getClient(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
txn, err := contract.RegisterNewDeviceIds(s.getTransactOpts(), contractID, deviceIDs)
|
||||
txn, err := contract.RegisterNewDeviceId(s.getTransactOpts(), contractID, deviceID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user